![]() |
Re: How to realize ssh & scp in Python
Rather than doing anything with passwords, you should instead use public
key authentication. This involves creating a keypair with ssh_keygen, putting the private key on the machine opening the ssh connection (~/.ssh/id_rsa), then listing the public key in the remote system's ~/.ssh/authorized_keys. If you don't want to use this approach, `pexpect'[1] is supposed to be able to perform this sort of tasks, and one of its examples is called `sshls.py'. I just downloaded it, and after changing the ssh commandline to include -o 'PreferredAuthentications password' it worked for me. In another recent thread, a different poster claimed it didn't work, so your results may vary. Jeff [1] http://pexpect.sourceforge.net/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (GNU/Linux) iD8DBQFC46OHJd01MZaTXX0RAtgpAJwM1mHLfqSkJeTcQNc7d+ GAo7JdQgCggj8q yZkice+9SbCDeUxH/Lu++6Y= =w5OL -----END PGP SIGNATURE----- |
| All times are GMT. The time now is 08:45 AM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.