Re: rsync-backup

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

 



Chris Purcell wrote:
I tried this on both the backup machine, and the machine to be backed
up. I still get prompted for a password. Could you (or someone else)
provide an example of how you would use this in a script that uses rsync
and ssh to backup files from one machine to another? I read the man
pages for ssh-agent and ssh-add, and it was not clear to me. The eval
function provides ssh-agent's pid, but I'm not sure how to use it in
this case.

TIA,
Bill


Try this...

Connnect FROM comp = Tiger
Connect TO comp = Lion

From Tiger...

ssh-keygen -t dsa (when asked for location and password, just press enter) scp ~/.ssh/id_dsa.pub root@lion:/root

From Lion...
cat /root/id_dsa.pub
ssh-dss
AAAB3NzaC1kc3MAAACBAPDKnsR29YiaAgjBbqIGh/78NXjNRA3fwjMFVjv3WE9wLc8TUvxhE7lBk9kBbu2s5Ny4bvm5ZMREebKd1fsoAoXaXA8jgBb84jbsBu6QTBhFgH7iRHSCeogvirzV2EZtgsL0vQtvrVaTT5VeNgkPEPERLymGo2uJB7yrbNMkwyBxAAAAFQDxH4VVE6I0kob6zjFrgS5gPppGfwAAAIEAwwL1MWM16isiEpeJO+H9cBOcjBsHJsYzRAd5Z3kOV9DZ7ZhBK6Ljd+bk6zyEygcq6dXu1P1DqRlEUXtS9LxzO0pVsNZQFn0sf2fT/4ET4N7MbFiHJun1IfEfUV//NZJq8NX2GrN1lhmI9bhidNYMD+AJcLPn1ewh2XUxPn0NiIgAAACAMugkdgXuPwdMKLQmaZeb8ufCvrqN+rnAiBWmplOSvw3ccwN+Xjp5PHgnyn4CVkHo4q/AQYPJXJGePb1lt0BxyJri5aqvBWjq9SPnKyfQDPxaFuglbxt4d5hhMqtUZU3HnRR7QGJ3V6glydBB1ZlqExWWdgkqijyVY47wPFGdafY=
root@tiger

Open id_dsa.pub with vi and prepend from=tiger

cat /root/id_dsa.pub
from="192.168.1.81" ssh-dss
AAAAB3NzaC1kc3MAAACBAPDKnsR29YiaAgjBbqIGh/78NXjNRA3fwjMFVjv3WE9wLc8TUvxhE7lBk9kBbu2s5Ny4bvm5ZMREebKd1fsoAoXaXA8jgBb84jbsBu6QTBhFgH7iRHSCeogvirzV2EZtgsL0vQtvrVaTT5VeNgkPEPERLymGo2uJB7yrbNMkwyBxAAAAFQDxH4VVE6I0kob6zjFrgS5gPppGfwAAAIEAwwL1MWM16isiEpeJO+H9cBOcjBsHJsYzRAd5Z3kOV9DZ7ZhBK6Ljd+bk6zyEygcq6dXu1P1DqRlEUXtS9LxzO0pVsNZQFn0sf2fT/4ET4N7MbFiHJun1IfEfUV//NZJq8NX2GrN1lhmI9bhidNYMD+AJcLPn1ewh2XUxPn0NiIgAAACAMugkdgXuPwdMKLQmaZeb8ufCvrqN+rnAiBWmplOSvw3ccwN+Xjp5PHgnyn4CVkHo4q/AQYPJXJGePb1lt0BxyJri5aqvBWjq9SPnKyfQDPxaFuglbxt4d5hhMqtUZU3HnRR7QGJ3V6glydBB1ZlqExWWdgkqijyVY47wPFGdafY=
root@tiger

cat id_dsa.pub >> /root/.ssh/authorized_keys

From Tiger...

Now you should be able to run ssh commands with entering a password...


ssh root@lion echo "success"
success


Chris Purcell, RHCE





I already know how to run ssh without using a password (i.e. create a key that has no password, and scp that key to the other machine). I thought there was a better way than to create keys that don't have passwords.


Bill


-- redhat-list mailing list unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe https://www.redhat.com/mailman/listinfo/redhat-list

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux