Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #96137

Re: issue while doing pexpect ssh

From Laura Creighton <lac@openend.se>
Subject Re: issue while doing pexpect ssh
References <3f4642c2-d548-4089-87c2-f3abb4ccb224@googlegroups.com> <CAPTjJmrTXFxAjL_MpRO4d++GGd_dCc1Morf7=n7S6JimRo=U_g@mail.gmail.com>
Date 2015-09-08 18:43 +0200
Newsgroups comp.lang.python
Message-ID <mailman.228.1441730631.8327.python-list@python.org> (permalink)

Show all headers | View raw


In a message of Tue, 08 Sep 2015 23:57:41 +1000, Chris Angelico writes:
>On Tue, Sep 8, 2015 at 9:37 PM,  <harirammanohar159@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

This poor soul cannot login at all. He needs this hack to let him
su some-other-user because of a draconian policy he cannot do
anything about.  If he could just log in, one heck of a lot of
other things would be simpler for him ...

Laura

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

issue while doing pexpect ssh harirammanohar159@gmail.com - 2015-09-08 04:37 -0700
  Re: issue while doing pexpect ssh Laura Creighton <lac@openend.se> - 2015-09-08 14:12 +0200
  Re: issue while doing pexpect ssh Chris Angelico <rosuav@gmail.com> - 2015-09-08 23:57 +1000
  Re: issue while doing pexpect ssh jmp <jeanmichel@sequans.com> - 2015-09-08 16:56 +0200
  Re: issue while doing pexpect ssh Laura Creighton <lac@openend.se> - 2015-09-08 18:43 +0200
  Re: issue while doing pexpect ssh harirammanohar159@gmail.com - 2015-09-09 01:58 -0700
    Re: issue while doing pexpect ssh Laura Creighton <lac@openend.se> - 2015-09-09 12:45 +0200
  Re: issue while doing pexpect ssh harirammanohar159@gmail.com - 2015-09-09 02:19 -0700
    Re: issue while doing pexpect ssh Laura Creighton <lac@openend.se> - 2015-09-09 12:47 +0200
  Re: issue while doing pexpect ssh harirammanohar159@gmail.com - 2015-09-09 04:22 -0700
  Re: issue while doing pexpect ssh harirammanohar159@gmail.com - 2015-09-09 22:18 -0700
  Re: issue while doing pexpect ssh harirammanohar159@gmail.com - 2015-09-09 23:08 -0700

csiph-web