Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #96128
| Path | csiph.com!goblin2!goblin1!goblin.stu.neva.ru!uio.no!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!nzpost1.xs4all.net!not-for-mail |
|---|---|
| Return-Path | <rosuav@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.011 |
| X-Spam-Evidence | '*H*': 0.98; '*S*': 0.00; 'cc:addr:python-list': 0.09; '===========': 0.09; 'str,': 0.09; 'subject:while': 0.09; 'sys.stdout': 0.09; 'typeerror:': 0.09; 'question.': 0.13; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'readable': 0.16; 'simplifies': 0.16; 'subject:issue': 0.16; 'subject:ssh': 0.16; 'wrote:': 0.16; 'bytes': 0.18; '2015': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'sep': 0.22; '(or': 0.23; 'header:In-Reply-To:1': 0.24; 'error': 0.27; 'message- id:@mail.gmail.com': 0.27; 'disk': 0.27; 'actual': 0.28; 'embed': 0.29; 'transaction': 0.30; 'code': 0.30; 'getting': 0.33; 'source': 0.33; 'tue,': 0.34; 'received:google.com': 0.35; 'best,': 0.35; 'follows:': 0.35; 'but': 0.36; 'child': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'missing': 0.37; 'means': 0.39; 'rather': 0.39; 'where': 0.40; 'some': 0.40; 'your': 0.60; 'more': 0.63; '=====': 0.84; '============': 0.84; 'chrisa': 0.84; 'password;': 0.84; 'subject:doing': 0.84; 'to:none': 0.91 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=51THYS5BfK0O4sK7CgBpxLz6czzys2Zpcyq27h4jMXM=; b=A8XnKlNYR2CKiFH7MYpOFdOdtY+g1UAHv7adG1sLJAfcZ7DmoLjoRVHBilKtaKCZSc yw8lhLyFgzrQ9CRMj0GZXHSAQNhu/vsI4ZDC9m5YxxK5BcssLv0P+lYQM6AzpvMhLID5 N44YgDkPTwcjIvguwo/B1AkPOny86nNSU/BUouRnAgU4pi763GGKsA9YBddlkrq5WNVJ NK77TamG9blYDz7hNqEwN6SiTZdfkUJhtqis2HKMrOpwLlC2Zp8GiIsEZkGV5uK798cJ /uxYPsDy/17Y56f5qt24zw8wbckdpmqGCARUKtX1dLI3D1TR+yFDxkHm+SPTUc0vENTc hAIQ== |
| MIME-Version | 1.0 |
| X-Received | by 10.50.98.7 with SMTP id ee7mr41501497igb.13.1441720661248; Tue, 08 Sep 2015 06:57:41 -0700 (PDT) |
| In-Reply-To | <3f4642c2-d548-4089-87c2-f3abb4ccb224@googlegroups.com> |
| References | <3f4642c2-d548-4089-87c2-f3abb4ccb224@googlegroups.com> |
| Date | Tue, 8 Sep 2015 23:57:41 +1000 |
| Subject | Re: issue while doing pexpect ssh |
| From | Chris Angelico <rosuav@gmail.com> |
| Cc | "python-list@python.org" <python-list@python.org> |
| Content-Type | text/plain; charset=UTF-8 |
| 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.223.1441720664.8327.python-list@python.org> (permalink) |
| Lines | 23 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1441720664 news.xs4all.nl 23730 [2001:888:2000:d::a6]:53295 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:96128 |
Show key headers only | View raw
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
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll 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