[paramiko] remote command info

stefano landucci marlonbasta at gmail.com
Tue Jan 26 14:20:21 PST 2010


Hi,

I'm a paramiko's newbie. I started with a simple ssh connection and command
execution like below:

import sys
import paramiko

client = paramiko.SSHClient()
client.load_system_host_keys()
ip = 'ip_server'
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())

client.connect(ip,port=22,  username='my_user',password='******')


i, o, e = client.exec_command('ls -la')

print o.read()

client.close()

I don't understand the steps to exec multiple commands, like the example
below.
Es: if I exec before  "cd /etc" command and after few time I want to exec a
"ls" command. What I do?

Sorry for my base English.

Regards.

B_and_s
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lag.net/pipermail/paramiko/attachments/20100126/42baeeee/attachment.html>


More information about the paramiko mailing list