Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


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

rsync/ssh passwords



Since we're contemplating getting back to techie topics, I  have  one
that's been annoying me for a while.

I've been using rsync to backup/mirror files on several machines.   I
usually  call  rsync from any of several scripts, which does the same
command with different hostnames.  I use ssh

The problem is that, after it's churned for a while copying files  to
or  from host1, it proceeds to host2, which then asks for a password.
Usually I'm looking at some other  window  at  the  time,  and  don't
notice  for a while that the rsync window wants another password.  By
the time I notice it, host2 has already times out the  operation.   I
don't  see  any clue of this, of course, so I type the password - and
get an error message. That part of the rsyc process has now bombed.

The obvious thing is to have the script know the passwords.  But this
doesn't work It seems that ssh does an end run around the script, and
talks directly to /dev/tty  to  get  the  password.   The  script  is
sleeping,  of  course,  waiting on the rsync command, and has no idea
that this is happening.

The ssh docs don't seem to mention this at all. Is there any kown way
to get ssh to play nice and accept a password from a parent process?

If all else fails, I suppose I can pull out  expect  and  use  it  to
defeat this misuse of /dev/tty. That is one of the things that expect
was invented for. But this is sorta like swatting flies with a sledge
hammer.  It would be nicer if there were some simple, elegant way for
my scripts to tell rsync "Use this password: ..."

If nobody knows, I'll just use expect.





BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org