The default port of SSH is 22 and I want to switch to a higher port number for security purposes (working on open Wi-Fi, so) and also to be able to allow SSH into my device locally. I also want my SFTP server to be on that exact same higher port.
So hereās the issue. On other jailbreaks I used to be able to edit /etc/ssh/sshd_config and remove the hashtag before āPortā to allow customizing port number like I did with my linux machines. On unc0ver, however, the file sshd_config under the same directory appears to have faulty permissions which seems to me that sshd will not read its configuration because of this. I know this because upon modifying sshd_config to allow public key authentication and disable password login, it didnāt work until I changed the mask to 755.
However, changing the port number doesnāt work as expected AFTER a rejailbreak/reboot. So after I removed the hashtag and started a new sshd daemon by calling /usr/sbin/sshd, yes, I can ssh into the device at the port number specified. The issue becomes, if I reboot and then jailbreak, sshd will be running on port 22 again instead of the port specified in /etc/ssh/sshd_config. (The whole file doesnāt seem to have been read by the daemon) Very weird issue indeed. When troubleshooting with /usr/sbin/sshd -d I donāt see a problem coming out of the console except that itās running on port 22 instead of the one I specified.
Worth to mention that I did try other working OpenSSH packages to troubleshoot. They include that really old version from 2016 on saurikās repo, the relatively newer one on CSās repo, but both didnāt survive a reboot due to the fact that unc0ver seems to have automatically replaced its supposedly latest version with unusable sshd_config back after each reboot even if I have āReinstall OpenSSHā toggled off in its Settings.
Anyone has some insights on this or might want to share how one can change its port number on unc0ver?
Thereās probably something wrong with the OpenSSH bundled with unc0ver since Iāve reinstalled it through Cydia (sbingerās repo) and unc0ver multiples times and even if I start fresh the sshd_config is still not functioning.
Also since Iām posting this I also got the problem of all fakesigned apps crashing on unc0ver even if used the same ipas to reinstall them. I already have AppSync Unified installed from Karenās repo but still. They used to work fine on Electra so Iām not quite sure whatās causing this. On the pro side I did experience the exploit process being much much smoother with voucher_swap on the 3.0 version. Huge thanks to the developers!
This is not a bug. You should modify the launch daemon plist instead.
@JQ555888 ^
This is not a bug. You should modify the launch daemon plist instead.
Ah I see now. Thank you!
EDIT: Yes. Confirm it works. Indeed itās /Library/LaunchDaemons/com.openssh.ssh.plist that I should have been looking into.
I donāt see how to do it. I tried adding <string>-p</string><string>2222</string> under ProgramArguments but that didnāt do it.
Edit: I found you have to change the SockServiceName from ssh to 2222 in the LaunchDaemon plist. Adding args -p 2222 or changing the port in /etc/ssh/sshd_config will not do anything. However, you can still disable password based authentication using /etc/ssh/sshd_config.
Thought I'd leave this here in case anyone else ever comes across this.
I donāt see how to do it. I tried adding
-p 2222 under ProgramArguments but that didnāt do it.Edit: I found you have to change the
SockServiceNamefromsshto2222in the LaunchDaemon plist. Adding args-p 2222or changing the port in/etc/ssh/sshd_configwill not do anything. However, you can still disable password based authentication using/etc/ssh/sshd_config.Thought I'd leave this here in case anyone else ever comes across this.
Thanks a million!! Iāve been desperate for this exact fix. I had been trying to modify the plist to -f /etc/ssh/sshd_config which didnāt work either.
Unc0ver should by default SSH on either port 2222, or 22 and 2222, because iOS deliberately blocks any app from connecting to localhost:22. Currently, you literally need 2 devices just to get to a terminal on the device youāre using.
EDIT 2020/04/17:
@pwn20wndstuff you should really reconsider this. Why have a jailbreak default to an SSH port you canāt use on the device!? You needlessly require 2 devices. The ideal solution would be a config for both 22 and 2222, I donāt know if thatās possible.
But the /Library/LaunchDaemons/com.openssh.ssh.plist SockServiceName āsshā ā”ļø ā2222ā definitely works to move it to 2222. Otherwise itās needlessly very confusing and frustrating for new jailbreakers wondering why they canāt SSH to their own device or 127.0.0.1.
I donāt see how to do it. I tried adding
-p 2222 under ProgramArguments but that didnāt do it.Edit: I found you have to change the
SockServiceNamefromsshto2222in the LaunchDaemon plist. Adding args-p 2222or changing the port in/etc/ssh/sshd_configwill not do anything. However, you can still disable password based authentication using/etc/ssh/sshd_config.Thought I'd leave this here in case anyone else ever comes across this.
OMG thanks, now it works...
@Siggi88
Thank you so much. This is still relevant and working on unc0ver for 13.5
def worth putting this info in a more prominent place. Glad I was able to "unc0ver" this crucial information!
Thanks so much @Siggi88 what a legend!
Many thanks for this. I'd had a look at the plist but didn't quite get that the "ssh"
Can someone help me? I installed OpenSSH and Filza. But when I enter the
/Library/LaunchDaemons/com.openssh.ssh.plist SockServiceName āsshā ā”ļø ā2222ā definitely works to move it to 2222.
I cant get it to change to 2222, when i delete ssh and make it 2222 and click on save FilzaEscaped crashes. What can I do? It seems like I dont have the right permission to edit the file.
What is FilzaEscaped and why are you using that instead of the real Filza?
I suspect this is your problem.
ŁŁ Ų³ŲØŲŖŲ Ł”Ł„ Ų£ŲŗŲ³Ų·Ų³Ų Ł¢Ł Ł¢Ł ŁŁ Ł”:ل٨ ŲµŲ ŁŲŖŲØ badger200 notifications@github.com:
What is FilzaEscaped and why are you using that instead of the real Filza?
I suspect this is your problem.On Thu, Aug 13, 2020 at 10:44 AM Vsteegman notifications@github.com
wrote:Can someone help me? I installed OpenSSH and Filza. But when I enter the
/Library/LaunchDaemons/com.openssh.ssh.plist SockServiceName āsshā ā”ļø
ā2222ā definitely works to move it to 2222.I cant get it to change to 2222, when i delete ssh and make it 2222 and
click on save FilzaEscaped crashes. What can I do?ā
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<
https://github.com/pwn20wndstuff/Undecimus/issues/335#issuecomment-673554343
,
or unsubscribe
<
https://github.com/notifications/unsubscribe-auth/ABNV24MHS22JFNMUUUUJBJLSAQC6BANCNFSM4GWA2PVQ.
>
Sent from Gmail Mobile
ā
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/pwn20wndstuff/Undecimus/issues/335#issuecomment-674303547,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AN7M56HB4Z3GQAQ5OTC4G6DSAW6RJANCNFSM4GWA2PVQ
.
Most helpful comment
I donāt see how to do it. I tried adding <string>-p</string><string>2222</string> under ProgramArguments but that didnāt do it.
Edit: I found you have to change the
SockServiceNamefromsshto2222in the LaunchDaemon plist. Adding args-p 2222or changing the port in/etc/ssh/sshd_configwill not do anything. However, you can still disable password based authentication using/etc/ssh/sshd_config.Thought I'd leave this here in case anyone else ever comes across this.