On Tue, Sep 8, 2015 at 9:37 PM,  <harirammanohar...@gmail.com> wrote:
> Some where i am missing simple logic.... :)
>
> =====
> child = pexpect.spawn('ssh hari@hostname')
> child.logfile = sys.stdout
> child.expect('hari\'s Password: ')
> =====
>
> getting error as follows:
> ============
> child.expect('hari\'s Password: ')
> TypeError: must be str, not bytes
> ===========

Laura's already answered your actual question. But I would recommend
using public key login rather than keying in a password; it's a lot
more secure, as it means you don't have to embed a password in your
source code (or at very best, on your hard disk in some other readable
and decryptable way). It also simplifies the transaction
significantly.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to