src123
Posts: 9
Joined: Wed Mar 19, 2014 11:07 am

ssh over python from pi

Tue Apr 29, 2014 4:04 am

hello guys!!! well i am pretty new to python and i would like to know what a pyhton script in my pi should be to execute a dos command in my windows pc which is connected to my pi using a cross cable and over ssh.

ghans
Posts: 7882
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: ssh over python from pi

Tue Apr 29, 2014 5:05 am

Do you already have a SSH server running on your Windows
machine ?


ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

src123
Posts: 9
Joined: Wed Mar 19, 2014 11:07 am

Re: ssh over python from pi

Tue Apr 29, 2014 6:15 am

@ghans

yeah!! like say my pi is connected over by putty running on windows.. and I would like to say run" sudo python script.py".. which would send a dos command to my this client windows.. to be executed by this client windows!!!

ghans
Posts: 7882
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: ssh over python from pi

Tue Apr 29, 2014 6:16 am

So you actually have a SSH client running on Windows ,
instead of a server ? PuTTY isn't a SSH server.


ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

src123
Posts: 9
Joined: Wed Mar 19, 2014 11:07 am

Re: ssh over python from pi

Tue Apr 29, 2014 8:45 am

ghans wrote:So you actually have a SSH client running on Windows ,
instead of a server ? PuTTY isn't a SSH server.


ghans
yes.. that is it....

User avatar
topguy
Posts: 6491
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: ssh over python from pi

Tue Apr 29, 2014 11:38 am

Executing stuff remotely on a windows machine can be ridiculously difficult.
- one forum thread mentioning "psexec" : http://social.technet.microsoft.com/For ... forum=ITCG
- psexec for linux, "winexec" : http://micksmix.wordpress.com/2012/08/0 ... rom-linux/

Alternative solution is to install an sshd server on your windows machine.
- There are several possible solutions for this, some are advanced some cost money..
http://stackoverflow.com/questions/1829 ... or-windows

User avatar
DougieLawson
Posts: 39120
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: ssh over python from pi

Tue Apr 29, 2014 11:42 am

http://sourceforge.net/projects/sshwindows/

Or you can install cygwin and have sshd running under that.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Return to “Python”