0

I would like to run a script on a device that I have established an SSH session into. However, the script is on my local Windows machine.

For my experiment, I have:

A python script on my local machine (Windows)

A jailbroken iOS device that I can SSH into using putty

I want to run the python script, that's located on my windows machine, on my jailbroken device.

Is this possible?

I know on a Mac, you can actually use the terminal to do just that and it would look something like this.

python [pythonfile].py [parameters] [target device]

The reason why I can't just run the python script on my device is because I can't install python on that device (at least it isn't on Cydia). Plus, I don't want to pay for an app that executes it.

Let me know if you have any suggestions, thanks.

rj2700
  • 1,770
  • 6
  • 28
  • 55
  • Oh wait, I didn't see this thread before I posted this.http://stackoverflow.com/questions/305035/how-to-use-ssh-to-run-shell-script-on-a-remote-machine?rq=1 let me check this out – rj2700 Mar 06 '14 at 02:34
  • no, the above link's solution doesn't work. plink isn't a recognized command in ios – rj2700 Mar 06 '14 at 02:37
  • also mind sharing what have you tried ? – Kunal Balani Mar 06 '14 at 02:54
  • I've used python [pythonfile].py [parameters] [target device] and variants like this with piping it through grep and adding ssh, but in Windows cmd line, ssh isn't a valid cmd (or at least it doesn't have an environment variable set up). – rj2700 Mar 06 '14 at 04:10
  • Python certainly is on Cydia. – Nate Mar 06 '14 at 20:28

1 Answers1

0

Have you tried this libssh2-for-iOS. Its an open source library which does exactly the same thing you are looking for.

Kunal Balani
  • 4,739
  • 4
  • 36
  • 73
  • Thanks for this. This looks very promising. However, do you know how I would install this? I've tried using this website http://x2on.de/2011/02/02/libssh2-for-ios-iphone-and-ipad-example-app-with-ssh-connection/ However, even after I transferred the bash script over to the device and changed it's permissions to be run by the root user, it still will not install. The cmds that I used on the iphone terminal (after the file transfer): chmod a+x build-all.sh ./build-all.sh openssl – rj2700 Mar 06 '14 at 04:24