Re: rsync question

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Matt Graham
Date:  
To: Main PLUG discussion list
Subject: Re: rsync question
On 2014-01-27 17:22, Brian wrote:
>> On Jan 27, 2014, at 5:13 PM, wrote:
>> I have a shell script [...]
>> works fine, except I have to enter the password for each segment.
>> rsync -avH --delete --progress /home/joe/dir1/
>> joe@192.168.0.64:/home/joe/dir1/
> That's rsync over ssh so you can use pub key auth.


To expand on what Brian wrote, have a look at your ~/.ssh directory.
It should contain several files. id_dsa and id_dsa.pub (or id_rsa and
id_rsa.pub) and authorized_keys or authorized_keys2. The id_rsa and
authorized_keys files should be chmodded 600, and ~/.ssh itself should
be chmodded 700. If you don't have the permissions on these things set
properly, then ssh tends to fail with confusing and misleading error
messages.

If you don't have a .ssh directory,
mkdir ~/.ssh
chmod 700 ~/.ssh
ssh-keygen
(follow the prompts, leave the passphrase blank for maximum
convenience)
touch ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys ~/.ssh/id_rsa

On the machine you'd like to connect to, you'll need to make a ~/.ssh
directory (chmodded 700 again) and a ~/.ssh/authorized_keys file
(chmodded 600) and append the ~/.ssh/id_rsa.pub file on your local
machine to the ~/.ssh/authorized_keys file on the remote machine.

Once you've done all that, you should be able to "ssh remote_machine"
and be logged in without having to enter a password. This is really
convenient in many ways. It also presents a security risk. If you've
got a blank passphrase, you have to keep your private key *private*,
because anybody who obtains that private key can then use it to ssh in
to all of your machines.

> Or do it over tcp/873 and use $RSYNC_PASSWORD


This means "create an rsyncd.conf file on the remote machine, then
start rsync on the remote machine with the --daemon option, then do
'rsync -av BLAH rsync://remote.machine.org/BLAH/ ' on your local
machine. " Using ssh keys would probably be a little easier.

--
Crow202 Blog: http://crow202.org/wordpress
There is no Darkness in Eternity
But only Light too dim for us to see.
---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change your mail settings:
http://lists.phxlinux.org/mailman/listinfo/plug-discuss