Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin3!goblin1!goblin.stu.neva.ru!news.astraweb.com!border6.a.newsrouter.astraweb.com!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!usenetcore.com!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.100 X-Spam-Evidence: '*H*': 0.80; '*S*': 0.00; 'subject:Python': 0.06; 'automate': 0.07; 'python': 0.11; 'command,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'ssh': 0.16; 'wrote:': 0.18; 'settings': 0.22; 'aug': 0.22; 'settings.': 0.24; "i've": 0.25; 'least': 0.26; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'that.': 0.31; 'invoke': 0.31; 'file': 0.32; 'run': 0.32; 'running': 0.33; 'fri,': 0.33; 'maybe': 0.34; "i'd": 0.34; 'could': 0.34; 'connection': 0.35; 'something': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'done': 0.36; 'should': 0.36; 'process,': 0.38; 'whatever': 0.38; 'to:addr:python-list': 0.38; 'that,': 0.38; 'though,': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.39; 'how': 0.40; 'even': 0.60; "you're": 0.61; 'save': 0.62; "you'll": 0.62; "you've": 0.63; 'making': 0.63; 'more': 0.64; 'honest': 0.78; 'etc,': 0.84; 'played': 0.84; '2013': 0.98 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:to :content-type:content-transfer-encoding; bh=y+RM6OzjlZxU8hwZj4aaR8syDf+oqW9V+0sdy0Rx+1Y=; b=ZHTOCNzUqq/YLBJ7W2Xk6bdomi6GD2PhNra1i+HmIK2XdC8eDP39v3X0NW0i3Wiqux 5FhMovDe3CYY4XkuMhZ87HOiZ9r3z5jo+ULOecU//O6x+THVatZAS0NzXBNsAIB0SY6n fbiocaFPzo6RX1JN7g9FACNh3dGF0TB0uBIICUr/dYH3QEKfOj7AU2COUcIKTjJUh8Wu ekTnD90TD9r6PXPHTHc8Fdm08+QEipwJcztqQKP/aX9ukn99eRzvdBDjw4tDIqxtf5rN l+O3IHTqC6VghZ2+VeJNKv6knRs2cp0IfUUqhE23QRTaLQg5e5PZ2+8ot+3M7QrlHa58 X/yA== MIME-Version: 1.0 X-Received: by 10.59.9.69 with SMTP id dq5mr4491225ved.87.1376009784509; Thu, 08 Aug 2013 17:56:24 -0700 (PDT) In-Reply-To: <9c89bff2-bcf0-4e08-a714-da51e137faae@googlegroups.com> References: <092fdbf5-1db3-4ea5-82ee-4b02cec80dc6@googlegroups.com> <9c89bff2-bcf0-4e08-a714-da51e137faae@googlegroups.com> Date: Fri, 9 Aug 2013 01:56:24 +0100 Subject: Re: Python 3 and SSH Tunnel From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 20 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1376009787 news.xs4all.nl 15899 [2001:888:2000:d::a6]:52826 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:52238 On Fri, Aug 9, 2013 at 1:46 AM, D. Xenakis wrote: > I've played with putty to achieve this but to be honest i'd like somethin= g more efficient. Opening putty everytime and making all the connection set= tings etc, and then running the programm, is kinda messy. Id like this to b= e done in an automatic way from the program so that things roll easy. > I thought maybe i should find a way how to call and run a batch file from= inside my python program or a powershell command, but i do not know even i= f that could work for the ssh tunneling. You should at very least be able to save PuTTY's settings under some name. Once you've done that, check PuTTY's docs for a way to invoke it with particular saved settings. I'm pretty sure there's a way to do that. The program can then invoke that as a background process, then go on to do whatever you need. Be aware, though, that you'll need to set up passwordless access (with a keypair) if you're to fully automate the process. But you may have already done that. ChrisA