How to change ssh port?
Summary:
I add a new ssh port, but can't connect, report "Connection refused".
Content (required):
1) Security List ->Ingress Rules -> add port 2222
2) Use http to test the port 2222, access ok.
3) sudo vim etc/ssh/sshd_config
add "Port 2222" and restart sshd.
sshd status display "Server listening on 0.0.0.0 port 2222"
4) ufw status: inactive; iptables status: inactive (dead)
5) test local : ssh -p 2222 ubuntu@localhost access ok.
6) test remote access failed, report "Connection refused".
Version (include the version you are using, if applicable):
Ubuntu 22.04
Code Snippet (add any code snippets that support your topic, if applicable):
Tagged:
0