'doh...okay....got it there, but I still want to run SSH in windows from python...
i'm currently using paramiko....this is a sample of my code which does an ls -al twice and doesnt seem to be working (note the server info is alright). Any other suggestion for a stable multi platform ssh client?
#!/usr/bin/env python
import sys, os, socket, threading
import paramiko, base64
blockSize=65536*16
server = host = "localhost"
port = 22
buf = 1024
addr =(host,port)
user = "user1"
passwrd = "user1"
t = paramiko.Transport(host)
t.connect(username=user, password=passwrd)
chan = t.open_session()
chan.exec_command('ls -al')
for line in chan.makefile('r+'):
print line.strip('\n')
chan.exec_command('ls -al')
for line in chan.makefile('r+'):
print line.strip('\n')
chan.close()
t.close()
Main Topics
Browse All Topics





by: ramromPosted on 2005-07-28 at 07:12:53ID: 14545847
Running under Windows? How are you starting the program? At a Command Prompt?
The error suggests you are doing C>ssh Is that true?