Milan Andric | 8 Oct 17:56 2009
Picon

Problems with "SSHException, Channel Closed"

Hello, I'm working on a web application that allows us to deploy our
software to our servers.  A key part of this is using an ssh client to
make changes to the servers.  I'm just in the beginning phases here
and am getting some intermittent SSHException exceptions that I don't
know how to debug.  If you could offer your guidance on what part of
the code is likely the problem or a good architecture to use, I would
greatly appreciate it.  I'm using the sftp put methods which seem to
work fine, the problem appears when I use the channel.exec_command
method.

Here's the stacktrace I keep running into.  Using paramiko 1.7.5,
python 2.4, django framework and an simple ssh.py library:

Traceback:
File "/usr/lib/python2.4/site-packages/django/core/handlers/base.py"
in get_response
  92.                 response = callback(request, *callback_args,
**callback_kwargs)
File "./apps/deploy/views.py" in project_detail
  75.                 output = project.activate_build(ssh_conn, new_build)
File "./apps/deploy/models.py" in activate_build
  197.         active_build = self.determine_active_build(conn)
File "./apps/deploy/models.py" in determine_active_build
  183.         stdout, stderr, code = conn.execute("grep VERSION %s" %
os.path.join( self.get_deploy_dir(),
settings.DEPLOY_VERSION_FILENAME))
File "./apps/deploy/ssh.py" in execute
  83.         channel.exec_command(command)
File "build/bdist.linux-i686/egg/paramiko/channel.py" in exec_command
  212.         self._wait_for_event()
(Continue reading)

Martin Lolek | 3 Oct 05:55 2009
Picon

Fwd: No output for some commands

Hello, I am paramiko modul novice. I tried run on channel commands:

chan = ssh_connection.open_session()
chan.exec_command('ps aux --sort pcpu')
for line in chan.makefile('r+'):
        print line
this works, but when I tried run with different command:
chan.exec_command('top -n 1')
or "crazy":
chan.exec_command('myVar=$(top -n 1) && echo $myVar')
I recive nothing an output. (I need parse CPU % ussage form "top" not from "ps".)
What i doing wrong? 
Thanks for any solution how I resolve it. 
_______________________________________________
paramiko mailing list
paramiko <at> lag.net
http://www.lag.net/cgi-bin/mailman/listinfo/paramiko
vishnu anand | 29 Sep 20:14 2009
Picon

Connecting my local machine to a linux box

Hi,
I am new to Paramiko, and I would like some advice as to how to go about this particular problem that I am facing.
 
I have three computers involved in this problem:
There is a real time DATA SERVER. The problem with DATA SERVER is it is located inside an internal private network. So I cannot connect directly to this server. I also have a server in the DATA SERVER. Lets call this server LINUX BOX. LINUX BOX has two network interfaces. One can be accessed through Internet via VPN, and the other one is connected with the same internal private network than DATA SERVER. That means that I can connect to DATA SERVER from LINUX BOX. The last computer involved is the USER COMPUTER. This computer is the one where the application is going to be executed. It is supposed to have Internet access and VPN access to LINUX BOX. This means that I should be able to connect to LINUX BOX from this computer, but I can't connect to DATA SERVER which is where the data comes from. So, my solution, is to create an echo server in LINUX BOX. This program would act as a bridge between the USER COMPUTER and the DATA SERVER. I will use another package called RPyC to control the LINUX BOX from the USER COMPUTER through an echo server opened from the LINUX BOX.
 
In order for me to gain control of the LINUX BOX, I need to establish a virtual connection with the DATA SERVER using Paramiko. Only then can the USER COMPUTER bind to the echo server connection opened in the LINUX BOX. Please tell me how to establish this connection. Thank you.

Yours truly,
Vishnu

Get easy photo sharing with Windows LiveT Photos. Drag n' drop
_______________________________________________
paramiko mailing list
paramiko <at> lag.net
http://www.lag.net/cgi-bin/mailman/listinfo/paramiko
vishnu anand | 29 Sep 20:03 2009
Picon

Error message: "No suitable address family for %s"

Hi,
I am new to Paramiko, and I would like some advice as to how to go about this particular problem that I am facing. I need to connect my local computer to a linux box on a linux server. I am unable to connect to the linux box using the code demo_simple.py in the demos folder that comes with installing paramiko. I am getting the following error,
 
"No suitable address family for %s"
 
The solution on the online forum gives me a patch for client.py but I cannot locate this file in order to apply it. Could you please give me an alternative solution for this problem or could you please tell me how to locate this specific file "build\bdist.win32\egg\paramiko\client.py". I found a couple of these files in the subdirectories where I had downloaded paramiko. I tried applying the patch to these files but I was unable to solve the problem.
 
Looking forward to receiving a reply. Thank you.
 
Yours truly,
Vishnu

Get easy photo sharing with Windows Live™ Photos. Drag n’ drop
_______________________________________________
paramiko mailing list
paramiko <at> lag.net
http://www.lag.net/cgi-bin/mailman/listinfo/paramiko
ssteinerX@gmail.com | 13 Sep 19:21 2009
Picon

Build on OS X 10.6

I'm running OS X 10.6.  Everything was working mostly fine until I  
recently downloaded the latest version of paramiko (1.7.5) and ran the  
usual `setup.py install`.

For some reason, I now get a "wrong architecture" warning when trying  
to import:

Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "paramiko/__init__.py", line 69, in <module>
     from transport import randpool, SecurityOptions, Transport
   File "paramiko/transport.py", line 37, in <module>
     from paramiko.dsskey import DSSKey
   File "paramiko/dsskey.py", line 31, in <module>
     from paramiko.pkey import PKey
   File "paramiko/pkey.py", line 28, in <module>
     from Crypto.Cipher import DES3
   File "build/bdist.macosx-10.3-i386/egg/Crypto/Cipher/DES3.py", line  
7, in <module>
   File "build/bdist.macosx-10.3-i386/egg/Crypto/Cipher/DES3.py", line  
6, in __bootstrap__
ImportError: dlopen(/Users/ssteiner/.python-eggs/pycrypto-2.0.1-py2.6- 
macosx-10.3-i386.egg-tmp/Crypto/Cipher/DES3.so, 2): no suitable image  
found.  Did find:
         /Users/ssteiner/.python-eggs/pycrypto-2.0.1-py2.6-macosx-10.3- 
i386.egg-tmp/Crypto/Cipher/DES3.so: mach-o, but wrong architecture

Does anyone know how to make it build properly on OS X 10.6?

I Googled but came up empty handed.

If someone can tell me how to fix this, I'll be happy to write a blog  
post describing the solution and I'll post a link back to the list so  
maybe it can make it into the docs...

Thanks!

S
Greg Lindstrom | 9 Sep 14:09 2009

Problem upgrading paramiko

Hello,

I'm running paramiko on Gentoo Linux.  We have been running the same version of paramiko (0.9, if memory serves) for years to handle sftp duties.  Yesterday wile attempting to install "Earnest" I accidentally overwrote the production library rather than the sandbox and then found out the libraries were not backed up (that's being corrected but I still have the following problem).  The box running our production routines have extremely limited Internet access.  I pulled and installed the pyCrypto 2.0.1 package, transferred it to the production box via scp and installed it, which appears to have succeeded.  It is installed in python2.4/site-packages/Crypto.

When I pull the Paramiko 1.7.5 code and scp it over to production, I get the following error messages:

glindstrom <at> bender ~ $ cd pycrypto-2.0.1
glindstrom <at> bender ~/pycrypto-2.0.1 $ sudo python setup.py install
running install
running build
running build_py
running build_ext
running install_lib
glindstrom <at> bender ~/pycrypto-2.0.1 $ cd ../paramiko-1.7.5
glindstrom <at> bender ~/paramiko-1.7.5 $ sudo python setup.py install
running install
running bdist_egg
running egg_info
writing requirements to paramiko.egg-info/requires.txt
writing paramiko.egg-info/PKG-INFO
writing top-level names to paramiko.egg-info/top_level.txt
writing dependency_links to paramiko.egg-info/dependency_links.txt
reading manifest file 'paramiko.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'paramiko.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-i686/egg
running install_lib
running build_py
creating build/bdist.linux-i686/egg
creating build/bdist.linux-i686/egg/paramiko
copying build/lib/paramiko/__init__.py -> build/bdist.linux-i686/egg/paramiko
<snip>
copying build/lib/paramiko/win_pageant.py -> build/bdist.linux-i686/egg/paramiko
byte-compiling build/bdist.linux-i686/egg/paramiko/__init__.py to __init__.pyc
<snip>
byte-compiling build/bdist.linux-i686/egg/paramiko/win_pageant.py to win_pageant.pyc
creating build/bdist.linux-i686/egg/EGG-INFO
copying paramiko.egg-info/PKG-INFO -> build/bdist.linux-i686/egg/EGG-INFO
copying paramiko.egg-info/SOURCES.txt -> build/bdist.linux-i686/egg/EGG-INFO
copying paramiko.egg-info/dependency_links.txt -> build/bdist.linux-i686/egg/EGG-INFO
copying paramiko.egg-info/requires.txt -> build/bdist.linux-i686/egg/EGG-INFO
copying paramiko.egg-info/top_level.txt -> build/bdist.linux-i686/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating 'dist/paramiko-1.7.5-py2.4.egg' and adding 'build/bdist.linux-i686/egg' to it
removing 'build/bdist.linux-i686/egg' (and everything under it)
Processing paramiko-1.7.5-py2.4.egg
Removing /usr/lib/python2.4/site-packages/paramiko-1.7.5-py2.4.egg
Copying paramiko-1.7.5-py2.4.egg to /usr/lib/python2.4/site-packages
paramiko 1.7.5 is already the active version in easy-install.pth

Installed /usr/lib/python2.4/site-packages/paramiko-1.7.5-py2.4.egg
Processing dependencies for paramiko==1.7.5
Searching for pycrypto>=1.9
Download error: (97, 'Address family not supported by protocol') -- Some packages may not be found!
Download error: (97, 'Address family not supported by protocol') -- Some packages may not be found!
Couldn't find index page for 'pycrypto' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Download error: (97, 'Address family not supported by protocol') -- Some packages may not be found!
No local packages or download links found for pycrypto>=1.9
error: Could not find suitable distribution for Requirement.parse('pycrypto>=1.9')


It appears that we are looking for pycryto 1.9 or greater, which I have, but cannot find it.  Is it possible to install this with restricted Internet access?  

Thanks
--greg

==============================================================
"We are the music makers, and we are the dreamers of dreams." (O'Saughnessy)

Greg Lindstrom, IT Manager 501 975-4859
Novasys Health, Little Rock, AR greg.lindstrom <at> novasyshealth.com

This email and any attachments to it are privileged and confidential and are intended solely for use of the individual or entity to which they are addressed. If the reader of this message is not the intended recipient, any use, distribution, or copying of this communication, or disclosure of all or any part of its content to any other person, is strictly prohibited. If you have received this communication in error, please notify the sender by replying to this message and destroy this message and delete any copies held in your electronic files. Thank you.

 

_______________________________________________
paramiko mailing list
paramiko <at> lag.net
http://www.lag.net/cgi-bin/mailman/listinfo/paramiko
Tony Risinger | 3 Sep 08:55 2009
Picon

SSHClient compression?

is there a way to use compression and still leverage the higher level
features of SSHClient?  im not very familiar with paramiko, but
looking at the source code, specifically:

lines: 290-295
http://www.lag.net/paramiko/docs/paramiko.client-pysrc.html

the transport is created and the client immediately started.  from
what i understand from reading the transport class is that
use_compression() must be triggered before start_client.  i dont see a
way to pass a configured transport, or a way to activate compression.

right now i am building the transport manually from following demo.py;
am i missing anything here?  i am building a log visualizer (Vpython)
app that basically muxes/tails uncompressed files from several
servers, and i would think compression would be desirable.
Joe Python | 1 Sep 16:23 2009
Picon

Paramiko - Proxy support

Anybody have success in using Paramiko library over Proxy (SOCKS4,5, HTTP) within windows environment?
Thank you.


- Jo

_______________________________________________
paramiko mailing list
paramiko <at> lag.net
http://www.lag.net/cgi-bin/mailman/listinfo/paramiko
Irooniam | 21 Aug 10:20 2009
Picon

ssh web proxy

Hello,

I've looked through the documentation & demo scripts specifically demo_server and forward but I'm still having problems.

Basically, I'm trying to create a SSH server who's sole purpose is to forward requests from clients (web proxy).  Something like the ssh command: ssh -D 9999 user <at> host

I've used portions of the demo_server script and I can see what's the src host/port & destination host/port but I haven't figured out how to actually have the SSH server forward and then return the data back to the client.

Any help would be appreciated.

Thanks.

_______________________________________________
paramiko mailing list
paramiko <at> lag.net
http://www.lag.net/cgi-bin/mailman/listinfo/paramiko
李昊 | 12 Aug 03:24 2009
Picon

Can not create SSHClient object.

Hi,

I'm a new user of paramiko and when I tried to start a ssh client using the code below,I got an exception saying:
"paramiko.SSHException: No suitable address"


import
paramiko
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(
paramiko.AutoAddPolicy())
ssh.connect('127.0.0.1', username='xxx',
password='xxx')
But when I using  SFTPClient with the same username and password, everything goes smoothly. I can logon the server and put/get files.

My python version is 2.5, does anybody had this experience before? Any advice will be appreciated much.

Thank you!
--
Lenciel
_______________________________________________
paramiko mailing list
paramiko <at> lag.net
http://www.lag.net/cgi-bin/mailman/listinfo/paramiko
Comete | 4 Aug 00:16 2009

Problem with port forwarding

Hi,

i'm trying to use Paramiko to create a tunnel like this:

ssh sshuser <at> sshserver -R 8000:localhost:5900

I precise that this command works perfectly.

Now this is the code i use:

#!/usr/bin/env python
# -*- encoding: utf-8 -*-
import paramiko

ssh_server = '192.168.1.1'
ssh_user = 'sshuser'
ssh_port = 22
passwd = 'sshpasswd'
port_to_forward = 8000
vnc_port = 5900

ssh = paramiko.SSHClient()
ssh.load_system_host_keys()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(ssh_server, port=ssh_port, username=ssh_user, password=passwd)
t = ssh.get_transport()
t.request_port_forward('', port_to_forward)
t.open_forwarded_tcpip_channel((ssh_server, port_to_forward), 
('localhost', vnc_port))

When i launch this script, i get this error:

paramiko.ChannelException: Administratively prohibited

And i don't know how to resolve this. Do you have any idea ? Maybe my 
code is wrong...

Thanks

Gmane