What's new

Connecting to localhost SSH unsandbox Prompt and SSH Term Pro

iphonefr33k

Member
Joined
Jun 5, 2012
Messages
91
Reaction score
2
I could only get MobileTerminal to work after JB IOS7. It seems that any application accessing ports below 1024 will not SSH. I changed the ports in /etc/ssh/sshd_config and /etc/services from the article linked below.

I installed nano to do the edits on my iphone and SSH'd into the phone from my terminal in a Mac to do this but can be done on your iphone MobileTerminal. I really don't like vi and do not know what the default editor is being used in the JB.

This did not break MobileTerminal but want to make sure it will not break anything in Cydia? There are a couple other ways of doing this after google searching but I thought this might be the better way.



Link:

Link >>>> reddit.com/r/jailbreak/comments/1ug095/solution_connecting_to_localhost_how_to_unsandbox/ceiqceo

EDITED:

It won't take affect until after a reboot or restart of the Daemon Service. You can run this command if you don't want to reboot:

launchctl unload /Library/LaunchDaemons/com.openssh.sshd.plist
<enter>
followed by
launchctl load /Library/LaunchDaemons/com.openssh.sshd.plist
<enter>
 
Last edited:
OP
I

iphonefr33k

Member
Joined
Jun 5, 2012
Messages
91
Reaction score
2
In case the link is dead here is the post:


Yes it is possible. I had the same frustration and use Prompt to automate all kinds of things so not having localhost ssh access was a non starter. (Agree w OP that MTerm sux..)

For a test , I tried connecting to local host (with Prompt) on an unrestricted port (something above 1024 or there abouts) and got a different error message which suggested that ios7 is "sand boxing" the lower (privileged) ports (only).

So , using ifile, I went to /etc/ssh/ and opened the sshd_config file as text, clicked edit and changed the port from 22 (default) to 50022. Do this by uncommenting out the port line:

Port 22
change to: Port 50022

Then save. Btw you don't need to touch the ssh_config file, that's for ssh client usage on cmd line..

Then in MTerminal type:
launchctl unload /Library/LaunchDaemons/com.openssh.sshd.plist<enter> followed by launchctl load /Library/LaunchDaemons/com.openssh.sshd.plist<enter>

I used 50022 as technically ports above 50000 are for users. Don't forget this will be the new port when logging in over SSH remotely such as winscp etc..

For good measure you could also go into the file /etc/services and change the ssh ports (two are listed, tcp and udp) from 22 to 50022. I'm not sure this matters for Prompt app , but might for apps that get the port based on the service name.

Worked for me, iphone 5s, a day ago. Reboot the phone if it doesn't take effect properly.

** EDIT **: I just tested these steps and you do indeed need to change the /etc/services files' ports too, for this to work. Also remember to 'su' in MTerm prior to the load/unload. (Or just skip and reboot to take effect). Also remember to uncomment the Port line by removing "#" as I didn't state that clearly. Good luck :)

Happy localhost-ing !



EDIT:

You do not have to use the port in the post above, just something over 50000, for example I chose 51312
 

Most reactions

Latest posts

Top