SSH Port 202 not working after changing /etc/ssh/sshd_config
-
Hi everyone,
Yesterday, I reinstalled and restored my server, and everything went smoothly without any issues. After the installation, I tried to change the SSH port to 202 in the
/etc/ssh/sshd_configfile. I added the following line:Port 202 # Do not use any other port. Only this port is not blocked by the Cloudron firewallThen, I restarted SSH using:
systemctl restart ssh(I noticed that older documents suggest
systemctl restart sshd, but that doesn't seem to work anymore). However, I still can't connect via port 202. I have to use the default connection command:ssh user@ip_serverI'm running Ubuntu 24.04.01 LTS. Is this method still valid for Cloudron, or did I miss something?
Thanks for your help!
-
After changing the port, then you have to connect this way:
ssh user@ip_server -p 202 -
After changing the port, then you have to connect this way:
ssh user@ip_server -p 202@matix131997 I tried connecting with the following command:
ssh -p 202 root@ipBut it fails with the error:
Connection refusedIt seems like port 22 is still open, and port 202 doesn't work. I was expecting that after the restart, port 22 would be closed and I would only be able to connect through port 202.
-
This should be in the Cloudron docs…
-
So, I didn't have to change
/lib/systemd/system/ssh.socketat all. But I did have to reboot the server since a simplesystemctl restart sshdid not work. Curiously, after reboot the socket file still has ListenStream as 22 but I can connect only to 202. -
G girish marked this topic as a question on
-
G girish has marked this topic as solved on
-
I was about to write a long time ago that the parameter for resetting SSH has changed:
sudo systemctl restart ssh.socket
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login