FAQ

On Tue, Sep 8, 2015 at 9:37 PM, wrote:
Some where i am missing simple logic.... :)

=====
child = pexpect.spawn('ssh hari at 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

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 3 of 12 | next ›
Discussion Overview
grouppython-list @
categoriespython
postedSep 8, '15 at 11:37a
activeSep 10, '15 at 6:08a
posts12
users4
websitepython.org

People

Translate

site design / logo © 2017 Grokbase