Remote Copying

Stuart Sears stuart at sjsears.com
Sat Aug 6 21:13:30 UTC 2005


drumil narayan enlightened us with the following gems on 08/06/2005
12:53 PM:
> Dear All,
> 
> am trying to copy some files from other machins with
> no luck when used rcp..with scp am able to do it. I do
> not want to use scp as it requires password.
You can prevent scp needing a password if you use an public/private key
pair to authenticate to the 'test' account on tengas.
ssh-keygen -t dsa (or rsa if you wish)
follow the prompts and then hit return when it asks you for a password.
this will create keys in /root/.ssh (assuming you run the command as root).
scp /root/id_dsa.pub test at tengas:.ssh/authorized_keys
(the remote /home/test/.ssh dir must exist. perms 700.)
this will need a password.
the next time you run scp it will not ask, as it will compare the
password on the keys, not the login password (if there even is one) for
the user 'test'.
you can use the same key for many different accounts in the same way.
just copy the public key into place.
password-less keys *are* a security risk, but no more than using rcp
without a password... in fact, arguably less as the keys much match the
originating host/user that created them.

alternatively you can put a (strong) password on the key you create and
use ssh-agent to manage the password for each session.
depends on whether you want to script the scp commands or not.
> 
> following is the command am using rcp
> 
> rcp test at tengas:/tmp/backup/ .
the scp version would be almost identical.

HTH
Stuart
--
Stuart Sears RHCE RHCX




More information about the Redhat-install-list mailing list