[Tutor] ssh connection

Ufuk Eskici ufukeskici at gmail.com
Tue Dec 18 09:03:52 CET 2012


I have Putty and I it runs from CMD successfully.

*C:\Users\eufuesk>*"c:\Program Files\Putty\putty.exe" -ssh [username]@
10.0.0.1
 -pw [password]

But I dont know how to send this command from Pyhton. :(


2012/12/17 Prasad, Ramit <ramit.prasad at jpmorgan.com>

> Please always include the list in your response (I have CC-ed the list).
>
> Ufuk Eskici wrote:
> >
> > Subprocess seems complicated, didnt understand.
> >
> > Also tried pexpect but couldnt install on Windows.
>
> Subprocess can be daunting to try and pick up, but it is
> not as bad as it looks at first glance. Subprocess gives you
> a way to run something from the cmd prompt (the Windows shell)
> and send/retrieve data from the prompt. It may be complicated
> depending on what commands you actually want to run and the type
> of output you are trying to retrieve.
>
> In order to make it work you need to be able to run the
> commands from cmd. Of course, you need to install an SSH
> client that will work from CMD prompt.
>
> Here are some links that might help.
> http://stackoverflow.com/questions/2407095/how-to-use-ssh-from-windows-cmd
> http://community.spiceworks.com/topic/205271-ssh-from-windows-command-line
>
>
> >
> > 2012/12/17 Prasad, Ramit <ramit.prasad at jpmorgan.com>
> > > Ufuk Eskici wrote:
> > > >
> > > > Hello All,
> > > >
> > > > Can we make an SSH connection with Pyhton 3.3 ?
> > > >
> > > > I want to connecto to my router, send commands and receive outputs.
> > > >
> > > > Thanks.
> > > > Ufuk
> > > You can try to use Paramiko. You may need to build it and it seems like
> > > it may work except for SFTP.
> > >
> > > https://github.com/paramiko/paramiko/issues/16
> > >
> > > If you switch to Python 2.x you can use Fabric (which relies on
> Paramiko).
>
>
> ~Ramit
>
>
> This email is confidential and subject to important disclaimers and
> conditions including on offers for the purchase or sale of
> securities, accuracy and completeness of information, viruses,
> confidentiality, legal privilege, and legal entity disclaimers,
> available at http://www.jpmorgan.com/pages/disclosures/email.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20121218/1def83a6/attachment-0001.html>


More information about the Tutor mailing list