[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [K12OSN] rsync question...



On Fri, 2002-11-15 at 06:48, Shawn Powers wrote:
> Sadly, I've even "RTFM"... and this escapes me...
> 
> With the command:
> 
> rsync -a -e ssh source/ username remotemachine com:/path/to/destination/
> 
> how on earth do I get the password to get "fed" into the command, so I 
> could set up a cron job?

You can use RSA/DSA keys to do ssh logins without passwords. Use
ssh-keygen to create an DSA keypair on the machine you will be logging
in from. Put the public key (id_dsa.pub) in the ~/.ssh/authorized_keys2
file on the machine to be logged into. No password necessary. Google on
ssh and rsync. Lots of people do this, the exact methods vary.

Something like:

(On machine you are logging in to:)
$ ssh-keygen -b 1024 -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/home/foo/.ssh/id_dsa):
Enter passphrase (empty for no passphrase): <leave this empty>
Enter same passphrase again: <again, emtpy>
Your identification has been saved in /home/foo/.ssh/id_dsa.
Your public key has been saved in /home/foo/.ssh/id_dsa.pub.
The key fingerprint is:
<otcal stuff here> foo bar k12 or us
$ scp .ssh/id_dsa.pub foo bar2 k12 or us:/home/foo/

(On machine you are logging in from:)
$ cd /home/foo
$ cat id_dsa.pub >> .ssh/authorized_keys2
$ rm id_dsa.pub
(Then try it out)
$ ssh foo bar k12 or us

Something like that. YMMV. Please "man ssh-keygen" before doing this
stuff so you getting into. Be sure to check the permissions on the
id_dsa file, it shouldn't be readable by anybody but the user.

-Dan Young
-Parkrose School District





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]