[paramiko] simple ssh server

Todd Whiteman toddw at activestate.com
Mon Aug 20 10:25:37 PDT 2007


Hi Caleb,

It's likely because your trying to use the Python keyword "pass" when 
trying to store the password, which would give a "Syntax Error", use:

password=getpass.getpass('password: ')
client.connect('localhost',port=2200,username=user,password=password)

Cheers,
Todd

caleb at szatan.net wrote:
> Hello
> 
> i've got a simple problem. Just i wrote a simple client with paramiko like
> this:
> 
> 
>> import paramiko , getpass
>> user=raw_input('username: ')
>> pass=getpass.getpass('password: ')
>> client = paramiko.SSHClient()
>> client.load_system_host_keys()
>> client.connect('localhost',port=2200,username=user,password=pass)
> command=""
>> while command != 'exit':
>>         command=raw_input('prompt: ')
>>         stdin,stdout,stderr=client.exec_command(command)
>>         for line in stdout:
>>                 print line.strip('\n')
>>         for line in stderr:
>>                 if line:
>>                         print line.strip('\n')
>> client.close()
>>
> It works perfectly with standard OpenSSH server and similar. But I have to
> write my simple ssh server
> which it'll be working with this client. Examples included in Paramiko
> package maybe are too complicated for me,
> because i went to the dead end.. :)
> Is there any possibilities to someone show me a solution of this problem?
> 
> please Help...
> 
> Caleb
> 




More information about the paramiko mailing list