[TriLUG] rsync connections - setting up passwordless ssh link
Jon Carnes
jonc at nc.rr.com
Sun Jan 4 17:51:02 EST 2004
On Sun, 2004-01-04 at 17:37, Turnpike Man wrote:
> OK, this is beginning to look like what I'm looking for, thanks Reggie.
>
> rsync -avze ssh /rtest poo:/rtest2 worked, required me to enter the password as
> if ssh or scp'ing to the machine. I didn't like the way it transferred the
> files, so I tried:
>
> rsync -avze ssh /rtest/ poo:/rtest2 which also worked after entering password.
> I liked the end result on poo better. The directory rtest itself was not
> copied, which is great, b/c I just need everything IN rtest. :)
>
> Now it appears I have to decide on doing the RSA stuff suggested by Chris or is
> there some other way?
>
> so the -z option, does that just compress during the transfer? Are the files
> on the receiving end just as usable as on the source end?
>
> thanks!
> David
>
That part is a Piece of Cake! Here is a step-by-step howto from Michael
Thompson of EasternRad fame (also found in the TriLUG Archives of
Wisdom)
=== Begin Archived email on setting ssh with no passwords ===
How to use ssh with rsa keys to authenticate without passwords.
(For running scripts as cron jobs)
This assumes that ssh is installed and configured on both clients and
servers.
On the client machine:
Use ssh-keygen -t rsa to create a private and public key pair, DO NOT
INSERT A PASSWORD. If you use the default settings, use will end up with
two files: $HOME/.ssh/id_rsa and $HOME/.ssh/id_rsa.pub. (Note: $HOME =
your home directory.) The id_rsa file should be chmod 600, the
id_rsa.pub can be 644. Also note that the $HOME/.ssh directory should be
chmod 600 on both clients and servers otherwise rsa authentication will
not work.(See below *)
On the server machine:
Copy the id_rsa.pub file to the $HOME/.ssh directory and insert it into
a file called $HOME/.ssh/authorized_keys. You can use 'cat id_rsa.pub >>
authorized_keys' to do this. The authorized_keys file should be chmod
644.
If you created your rsa key without a pass phrase this should allow you
to ssh to the server without a password.
* NOTE: chmod 600 on $HOME/.ssh directory will only work for the root
user. For regular users, use chmod 700 $HOME/.ssh.
=== end of archived note ===
HtH - Jon (read the archives) Carnes
More information about the TriLUG
mailing list