Start OpenSSH service on iphone from iphone terminal

Santoo Death XXXXXXXXXXXXXX picture Santoo Death XXXXXXXXXXXXXX · May 7, 2013 · Viewed 8.2k times · Source

The OpenSSH ssh daemon is a useful tool for iPhone development.

I use it to connect my MacOS @ my phone quickly.

Is it possible to start the service directly from the terminal, without using some toggle?

Answer

Nate picture Nate · May 7, 2013

I assume you're using a terminal directly on the phone, otherwise how could you get in to turn on the ssh daemon, right?

Anyway, you can use this command to start the service:

launchctl load /Library/LaunchDaemons/com.openssh.sshd.plist

and this one to stop it:

launchctl unload /Library/LaunchDaemons/com.openssh.sshd.plist

Note, that if you use this, and also have the SBSettings ssh toggle installed, its state (red=off, green=on) will be out of sync with the actual service. (You can just tap the SBSettings toggle a couple times, and it will be back in sync again)