SSH changing port issue

I'm running Debian 10. I've read like 10 instructions on how to change default SSH port from 22 to any desired but none of it seem to work.

I changed #Port 22 to Port 1111 in /etc/ssh/sshd_config. Restarted the service with service ssh restart and even rebooted the server.

And then I tried to connect: ssh -p 1111 user@hostname to no avail. It looks like the port is not open but I have no firewall whatsoever.

Seconly I tried to connect the usual way: ssh user@hostname which gives me ssh: connect to host hostname port 22: Connection refused.

service ssh status gives me

Nov 04 05:32:04 localhost systemd[1]: Starting OpenBSD Secure Shell server...
Nov 04 05:32:04 localhost sshd[904]: Server listening on 0.0.0.0 port 1111.
Nov 04 05:32:04 localhost sshd[904]: Server listening on :: port 1111.
Nov 04 05:32:04 localhost systemd[1]: Started OpenBSD Secure Shell server.

~# ss -tulpn | grep 1111
tcp   LISTEN 0      128                              0.0.0.0:1111       0.0.0.0:*                                                                                users:(("sshd",pid=904,fd=3))                                                  
tcp   LISTEN 0      128                                 [::]:1111          [::]:*                                                                                users:(("sshd",pid=904,fd=4))                                                 

Am I doing something wrong?


Solution 1:

For those, who's customer to 1&1 Internet Inc a.k.a. IONOS

They have their own firewall outside the virtual machine. That was the issue here.

It can be configured under Network > Firewall Policies in Cloud Panel.