Was Re: need wrapper for ssh/scp
drew.mcdowell at msfc.nasa.gov
Fri Apr 7 16:52:46 CEST 2000
Thomas Wouters <thomas at xs4all.net> wrote
> Help is easiest if you also explain what the problem is ;)
I'm trying to implement a script where I can enter my passphrase once, and
fire up identical processes on multiple hosts.
It's not quite as easy as I thought...
Oh, and I'm not allowed to use ssh-agent either. :(
> I already see one
> problem though: you read the password with 'string.strip(raw_input())',
> which means the terminating newline gets stripped off the password, but
> dont supply it with os.write(),
*doh* how'd that get in there? <wink>
Ok, I added the newline and sshd is showing that the script is logging
in...but no commands are being executed.
Any further advice?
>which means ssh thinks there is more
> password to come, and patiently sits waiting for it, untill you brutally
> kill it ;)
Hehe..I was getting a bit flustrated :)
> In your real app you probably want to use select(), by the way, before
> attempting to read something. Doing a read() when there's no data to be
> makes a blocking read, which can lead to deadlocks. See telnetlib for some
> examples on how to use it.
Thanks for the pointer...I'll look into it!
More information about the Python-list