On Friday 10 October 2003 13:35, Bill Tangren wrote: > MKlinke wrote: > > On Thursday 09 October 2003 10:41, Aly Dharshi wrote: > >>Hello, > >> > >> So how do you sort out the passwd when ssh asks for one, do you > >> have it in some secret file ? > > > > 'ssh-agent' is one option for this.. > > > > %eval `ssh-agent` > > %ssh-add > > > > This will store and apply the key when required. > > > > Regards, Mike Klinke > > Mike, > > 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 My notes: Machine A has the batch file that is used to drive rsync. Machine B is the machine to back up. On machine A create your public/private keys via ssh-keygen Copy the generated public key to Machine B (append the key to the appropriate "authorized_keys2" file) On machine A run: eval `ssh-agent` (make sure these are both back-tics `` ) On machine A run: ssh-add (You'll have to re-enter the keyphrase) On machine A you can now run: ssh <machine_B_IP> (and you should not be asked for a password.) For batch use change the line for BatchMode in /etc/ssh/ssh_config to: BatchMode yes You should now be able to run a script containing ssh commands: (note that the ssh-agent should be only viable for the current login session but that doesn't pose a problem for my use. I have run across a site that where someone created a utility to allow the ssh-agent to be accessible from a cron task or a shell other than the login shell but can't remember it right now.) Regards, Mike Klinke -- redhat-list mailing list unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe https://www.redhat.com/mailman/listinfo/redhat-list