Suggest design to accomodate non-unix platforms ?

pat pkugrinas at gmail.com
Wed Apr 18 10:00:52 EDT 2012


Paramiko provides SSH2 support and is platform-independent (implemented 
purely in Python). Try it and see if it works for you. Link: 
http://www.lag.net/paramiko/..

On 04/18/2012 04:35 PM, Richard Shea wrote:
> On a *nix box this is a reasonable bit of Python :
>
> cmd = "ssh -o StrictHostKeyChecking=no -i %s %s@%s '%s'>  %s" % (key,
> user, dns, "echo CONNECTION READY", tmp_file)
> result = os.system(cmd)
>
> ... on a Windows box it will fail because 'ssh' isn't part of Windows.
>
> There *are* ways of achieving the equivalent functionality in Windows,
> eg
>
> putty.exe -ssh user at host
>
> ... and that's only one of them.
>
> So I'm interested in suggestions/examples where a user can update a
> config file to specify by which means they want (in this case) the ssh
> functionality to be supplied.
>
> I'm thinking of something in a config file like this ...
>
> ssh_dropin = {exec: 'putty.exe -ssh %s@%s', args:['auser','somehost']}
>
> ... which I think would work and be sufficiently flexible to deal with
> alternatives to putty.exe but is there a more established (...
> better !) way of doing this stuff ?
>
> Thanks
>
> Richard.
>
>
>




More information about the Python-list mailing list