- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Remote copying and shells
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2003 06:59 PM
11-17-2003 06:59 PM
There is no file server and no remote mounting allowed, but I still need to keep several files (eg. /etc/bootptab) the same on all machines.
At present I am using FTP to copy files round each machine individually, but this is painful! Is there any way of writing a script such that it will prompt for a password on the remote system and then allow me to copy files?
I know that ignite-UX does something like this because at one point when booting a new client you get the line "Do you want bootsys to set the .rhosts file on that system at this time". I have looked through lots of books but cannot find how top do this (maybe I am looking in the wrong place!).
Please can anyone help?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2003 07:26 PM
11-17-2003 07:26 PM
Re: Remote copying and shells
- my most preffered method: scp with ssh-agent: you have to install ssh generate a Passphrase and via ssh-agent you can connect to each server (look at man ssh or search this forum)
- with ftp you can use .netrc to automate the transfer (look at man netrc)
- you can use a perl-script
something like this (you have to write a loop):
#!/opt/perl/bin/perl
use Net::FTP;
use File::Listing;
$dir = "/pub";
$host = "
$localdir = "
$ftp = Net::FTP->new($host, Timeout => 60 , Passive => 1);
chdir $localdir or die "Could not Changedir to $localdir \n";
if (! $ftp) {
$mmsg1 = "*** Host not found.\n";
$mmsg2 = "*** Error: $@\n";
print $mmsg1;
print $mmsg2;
return 0;
}
if ( ! $ftp->login("
$mmsg1 = "\n*** Login failed";
print $mmsg1;
return 0;
}
$ftp->pwd();
if( ! $ftp->cwd($dir)) {
$mmsg1 = "\n*** cd failed";
print $mmsg1;
exit 0;
}
if( ! $ftp->binary()) {
$mmsg1 = "\n*** binary failed";
print $mmsg1;
return 0;
}
if( $ftp->put($name)) {
$mmsg1 = "\n*** put failed";
print $mmsg1;
return 0;
}
...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2003 07:35 PM
11-17-2003 07:35 PM
Re: Remote copying and shells
http://expect.nist.gov/
-- Graham
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2003 07:49 PM
11-17-2003 07:49 PM
Re: Remote copying and shells
You can make use of ssh key based authentication and with a master copy of files, you can just scp the files if they are not in sync with your master copy. In this method no passwords asked. Yet secured.
Enjoy !!
Madhu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2003 07:57 PM
11-17-2003 07:57 PM
Re: Remote copying and shells
Where can I look for an "idiots guide". By the way I am running Trusted 10.20 on these machines
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2003 08:13 PM
11-17-2003 08:13 PM
Re: Remote copying and shells
you have to install ssh on each server/workstation, it's not part of HPUX basic installation.
In this thread you'll find information and links to download several ssh-implementation.
On HP-UX 10.20 we used openssh2.
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=131717
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2003 08:24 PM
11-17-2003 08:24 PM
Re: Remote copying and shells
Thank you,
Madhu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2003 09:48 PM
11-17-2003 09:48 PM
Re: Remote copying and shells
Any ideas? (or do I stick to my current laborious way of doing it!)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2003 10:08 PM
11-17-2003 10:08 PM
Re: Remote copying and shells
with SSH you still can execute comparably safe remote commands or do remote file copies even if you automate things.
It is at least safer than vanilla telnet or ftp sessions.
With SSH you can do RSA authentification.
Together with an ssh-agent you even avoid the risk of leaving public RSA keys on your remote login hosts.
Instead in your script you start an ssh-agent and supply it with all the public RSA keys that you require for the remote logins.
The remote SSH servers will then query your ssh-agent for the RSA keys (provided they are configured to allow this).
This is still safer than the other solutions I would say.
Please, consult the manpage of ssh-agent for details.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2003 01:31 AM
11-18-2003 01:31 AM
SolutionThis can be used with pax, cpio, cat,
Else you can write a script around ftp to do it
for instance
#!/usr/bin/ksh
ftp -v -n 2>&1 |&
exec 3>&p 4<&p
stty -echo
read passwd
state=0
echo open hpfrcu08 >&3
echo user ftp $passwd >&3
while read -u4 a b
do
echo ".$a.$b."
case $state in
0)
if [ "$a" = 230 ]
then
echo cd /pub >&3
state=1
fi
;;
1)
if [ "$a" = 250 ]
then
echo lcd /tmp >&3
echo get go >&3
state=2
fi
;;
2)
if [ "$a" = 226 ]
then
echo quit >&3
state=3
fi
;;
esac
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2003 02:28 AM
11-18-2003 02:28 AM
Re: Remote copying and shells
create two files with the list of files, you want to copy and the list of hosts.
greetings,
Michael
#!/bin/ksh
stty -echo
echo "passwd:\c"
read PASSWORD
stty echo
while read HOSTNAME
do
while read FILENAME
do
FILE=`basename ${FILENAME}`
DIR=`dirname ${FILENAME}`
ftp -i -n ${HOSTNAME}<
cd ${DIR}
lcd ${DIR}
put ${FILE}
EOF
done < filelist
done < hostlist
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2003 05:42 PM
11-18-2003 05:42 PM
Re: Remote copying and shells
notice:
- if you use ftp, cpio, rexec, telnet, ... your password is not encrypted over the network
- you have to remember 30 passwords(I hope you have different passwords on each machine). If you are using the same password or an algorithm or a "password-file" to remember 30 passwords, it is much more secure using RSA-Authentification with one Passphrase.
Chris