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


Groups > comp.lang.python > #96137

Re: issue while doing pexpect ssh

Path csiph.com!news.mixmin.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!nzpost1.xs4all.net!not-for-mail
Return-Path <lac@openend.se>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.002
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'cc:addr:python-list': 0.09; '===========': 0.09; 'received:openend.se': 0.09; 'received:theraft.openend.se': 0.09; 'str,': 0.09; 'subject:while': 0.09; 'sys.stdout': 0.09; 'typeerror:': 0.09; 'question.': 0.13; '>on': 0.16; 'cc:addr:lac': 0.16; 'cc:addr:openend.se': 0.16; 'from:addr:lac': 0.16; 'from:addr:openend.se': 0.16; 'from:name:laura creighton': 0.16; 'message-id:@fido.openend.se': 0.16; 'readable': 0.16; 'received:fido': 0.16; 'received:fido.openend.se': 0.16; 'simplifies': 0.16; 'subject:issue': 0.16; 'subject:ssh': 0.16; 'wrote:': 0.16; 'bytes': 0.18; 'laura': 0.18; 'hack': 0.18; '2015': 0.20; 'cc:addr:python.org': 0.20; 'cc:2**1': 0.22; 'sep': 0.22; 'simpler': 0.22; 'cc:no real name:2**0': 0.22; '(or': 0.23; 'all.': 0.24; 'chris': 0.26; 'error': 0.27; 'disk': 0.27; 'actual': 0.28; 'about.': 0.29; 'embed': 0.29; 'received:se': 0.29; 'transaction': 0.30; 'code': 0.30; 'getting': 0.33; 'tue,': 0.34; 'best,': 0.35; 'could': 0.35; 'follows:': 0.35; 'skip:> 10': 0.35; 'but': 0.36; 'child': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'missing': 0.37; 'charset:us-ascii': 0.37; 'things': 0.38; 'anything': 0.38; 'log': 0.38; 'means': 0.39; 'rather': 0.39; 'where': 0.40; 'some': 0.40; 'him': 0.60; 'your': 0.60; 'header :Message-Id:1': 0.61; 'policy': 0.63; 'soul': 0.72; '+1000,': 0.84; '=====': 0.84; '============': 0.84; 'header:In-reply-to:1': 0.84; 'password;': 0.84; 'subject:doing': 0.84
To Chris Angelico <rosuav@gmail.com>
cc "python-list@python.org" <python-list@python.org>, lac@openend.se
From Laura Creighton <lac@openend.se>
Subject Re: issue while doing pexpect ssh
In-reply-to <CAPTjJmrTXFxAjL_MpRO4d++GGd_dCc1Morf7=n7S6JimRo=U_g@mail.gmail.com>
References <3f4642c2-d548-4089-87c2-f3abb4ccb224@googlegroups.com> <CAPTjJmrTXFxAjL_MpRO4d++GGd_dCc1Morf7=n7S6JimRo=U_g@mail.gmail.com>
Comments In-reply-to Chris Angelico <rosuav@gmail.com> message dated "Tue, 08 Sep 2015 23:57:41 +1000."
MIME-Version 1.0
Content-Type text/plain; charset="us-ascii"
Content-ID <980.1441730620.1@fido>
Date Tue, 08 Sep 2015 18:43:40 +0200
X-Greylist Sender IP whitelisted, not delayed by milter-greylist-4.3.9 (theraft.openend.se [82.96.5.2]); Tue, 08 Sep 2015 18:43:42 +0200 (CEST)
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.228.1441730631.8327.python-list@python.org> (permalink)
Lines 32
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1441730631 news.xs4all.nl 23845 [2001:888:2000:d::a6]:43184
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:96137

Show key headers only | 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