Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.060 X-Spam-Evidence: '*H*': 0.89; '*S*': 0.01; 'subject:Python': 0.06; 'postgresql': 0.07; 'python': 0.11; 'anyone?': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'ssh': 0.16; 'wrote:': 0.18; 'trying': 0.19; 'thu,': 0.19; 'aug': 0.22; 'stick': 0.24; 'script': 0.25; 'header:In-Reply-To:1': 0.27; 'tried': 0.27; 'point': 0.28; 'host': 0.29; 'message- id:@mail.gmail.com': 0.30; "i'm": 0.30; '8:30': 0.31; 'invoke': 0.31; 'running': 0.33; 'but': 0.35; 'received:google.com': 0.35; 'remote': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'sure': 0.39; 'to:addr:python.org': 0.39; 'establish': 0.61; 'simply': 0.61; 'here': 0.66; 'informed': 0.78; 'pycrypto': 0.84; 'pc,': 0.91; 'tunnel': 0.91; '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; bh=OcAsdwd9mVP4TWLDdpalNO6RJiNNP+75Iq9kqL8UgYU=; b=tpd9hHvyI533b8YcyMRSQGiw/al9e0QiFHeJMt9pLaLfk1BZlUxCEyvMT/3jtJ23qy AjpCaUmwsn/VqxKMZZmZc8qs7nnTV60tiOrDwVNov+e0b9hvSkEWpllelA8UtBe6QRF8 LIfJDl6NMsNP9C4/UYeDq4CHi3OInb1R7e3MkuRvzw+sGhahRcoYNE2hx9VRfmjEcgO9 0sRvCc+9Nin9o7bBwTPTnrzqDXz3T+mUuvOT97dBK+K+AFdfv16FGuUBuz+QscdUZjCp X9Pg3pzljI290J9LqNQF1l9m5i51bwthHh6PYtOQwDI6c6p6zilbj0cSOmZ5c2yQNJTV ZZSA== MIME-Version: 1.0 X-Received: by 10.220.43.19 with SMTP id u19mr5386333vce.3.1376002484071; Thu, 08 Aug 2013 15:54:44 -0700 (PDT) In-Reply-To: <092fdbf5-1db3-4ea5-82ee-4b02cec80dc6@googlegroups.com> References: <092fdbf5-1db3-4ea5-82ee-4b02cec80dc6@googlegroups.com> Date: Thu, 8 Aug 2013 23:54:44 +0100 Subject: Re: Python 3 and SSH Tunnel From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 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: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1376002908 news.xs4all.nl 15886 [2001:888:2000:d::a6]:33059 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:52233 On Thu, Aug 8, 2013 at 8:30 PM, D. Xenakis wrote: > HOWTO anyone? > > What im trying to succeed here is create one SSH tunnel, so that i can connect from a python script running on my pc, to a remote MySQL database running on my Host and id like to stick with Python 3.3 . > > I contacted my host and he informed me that this is the only way. > > I tried pycrypto + paramiko but from what i have noticed, paramiko is not Python 3.3 ready. I'm not sure what exactly is going on here, but why not simply establish a tunnel using ssh(1) and then invoke your Python script separately? You simply point your script at a database on localhost, after establishing a tunnel from local 3306 to remote localhost:3306. No need to play with Python crypto. Alternatively, can you use PostgreSQL instead? :) ChrisA