need wrapper for ssh/scp
Andrew Patterson
andrew at fc.hp.com
Wed Mar 29 13:13:55 EST 2000
John Mitchell wrote:
>
> On Wed, 29 Mar 2000, Thomas Wouters wrote:
>
> > Does anyone have a wrapper or example code that will allow me to use ssh
> > and scp in a python script. Normally you would use some form of popen, but
> > I can't seem to feed ssh/scp a passphrase.
>
> do you really need to give it a passphrase? Depending on your security
> requirements, you can just copy ssh's keys around w/o using passwords.
>
> To do this, let's say your remote machine is named 'twaddle', remote user
> 'fiji', and you've already run ssh-keygen locally:
>
> % cat ~/.ssh/identity.pub | ssh fiji at twaddle \
> 'mkdir .ssh ; chmod 700 .ssh ; cat >>.ssh/authorized-keys'
>
> You have to type your password. Next, test the connection:
>
> % ssh fiji at twaddle ls
>
> If it works, with no password, you're home free. Go take a look at how to
> add 'fiji' to your ~/.ssh/config file and all will be well.
>
> I use ssh several times *an hour*. Good stuff!
>
> - j
Got this working. I was already doing the above, but the account was
protected by a passphrase. I since deleted the passphrase, and
everything works fine. I am still a little worried about security,
since enyone who has access to
the identity.pub file can now log into the remove machine. Embedding
passwords
in scripts, however, introduce their own sort of security holes.
Thanks,
Andrew
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Andrew Patterson Voice: (970) 898-3261
Hewlett-Packard Company/DSL FAX: (970) 898-2180
3404 East Harmony Road / MS 7 email: andrew at fc.hp.com
Fort Collins, Colorado 80525
More information about the Python-list
mailing list