Operating System - HP-UX
1753675 Members
5081 Online
108799 Solutions
New Discussion юеВ

Re: Copying files from one server to another on regular bases

 
SOLVED
Go to solution
Ganesan R
Honored Contributor

Re: Copying files from one server to another on regular bases

Hi Salman,

ssh-keygen is secure shell command.
You need to find if you have installed secure shell product on your server.

#swlist |grep -i secure
#swlist |grep -i ssh

If it is not installed you can install HP ported Secure Shell or openssh which is avialble in net.

HP secure shell can be downloaded from above link.

openssh is here.

http://www.openssh.com/
Best wishes,

Ganesh.
Salman Ahmed Qureshi
Frequent Advisor

Re: Copying files from one server to another on regular bases

hi,
Thanks, its working, but very very very slow. Why? FTP is quite fast. Can i make it fast like FTP? On my LAN, the transfer rate is 3MB per second
Thanks
Salman Ahmed Qureshi
Frequent Advisor

Re: Copying files from one server to another on regular bases

How to do this if i want to use ftp. Can anyone tell me what should i write in the script for using ftp command to do the same operation. I can provide password within that script for the usser which will be used to connect for files transfer using ftp.
Thanks
Richard Hepworth
Esteemed Contributor

Re: Copying files from one server to another on regular bases

Salman,

scp, sftp are always going to be slower than ftp due to the encryption.
You can write an ftp script including user/passwd information but this is not the best policy security wise.

You can use this:

ftp -n server <user username password
cd /directory
put file
bye
EOT
Malcolm Leckie
Occasional Advisor

Re: Copying files from one server to another on regular bases

Here is an extract from a script we use:

IPADDR="192.168.2.1"
USERNAME="remoteuser"
PASSORD="remotepassword"
SOURCEFILE="/home/username/file"
DESTFILE="/home/remoteuser/file"
(
ftp -vin <open $IPADDR
quote USER $USRNAME
quote PASS $PASSWORD
put $SOURCEFILE $DESTFILE
quit
END_SCRIPT
) | grep "226 Transfer complete." > /tmp/ftp$SRCFILE


The assignments for IPADDR, USERNAME, PASSWORD, SOURCEFILE and DESTFILE should be changed as appropriate. Please also note that the target directory structure needs to be in place (same restrictions as 'cp').


I would suggest that from a security point of view scp is a much better solution and should be used where possible.
Malcolm Leckie
Occasional Advisor

Re: Copying files from one server to another on regular bases

Apologies for almost repeating the posting from Richard - didn't see his response until after I had replied.

Malcolm
Salman Ahmed Qureshi
Frequent Advisor

Re: Copying files from one server to another on regular bases

Can "rcp" work without suplying any password just like "scp" works? If yes then how to setup this.
Thanks
Richard Hepworth
Esteemed Contributor

Re: Copying files from one server to another on regular bases

Salman,

Just create .rhosts in $HOME on the target server with:

sourceserver user

and then try rcp. With this in place it should not prompt for a password.

regards,

Richard
Dennis Handly
Acclaimed Contributor

Re: Copying files from one server to another on regular bases

>Richard: Just create .rhosts in $HOME on the target server with:

If your $HOME is over NFS, you can just list every machine in .rhosts with permission 600 and owner of the user:
machine1
...
Salman Ahmed Qureshi
Frequent Advisor

Re: Copying files from one server to another on regular bases

Hi,
Sourrce is ods
destination is devdb03
i have a user "oracle" on bother servers
i create .rhosts in /home/oracle/ which is home directory of user oracle and set permissions to 600. I created this on devdb03.
Now i am running rcp from ods-prim but facing error as follows.

$ rcp sqlnet.log devdb03:/home/oracle/
remshd: Login incorrect.


Please help thanks