I connected to Ubuntu server from my Mac terminal using ssh root@555.555.55.55 (not the real IP address), then I got an error ssh: connect to host 555.555.55.55 port 22: Connection refused. After that I tried the command ssh root@555.555.55.55 -p 55555, then I got the message root@555.555.55.55: Permission denied (publickey).
Before changing the port number I have installed ufw and I changed the port number using sudo nano /etc/ssh/sshd_config.
Now I'm not able to connect to my server. Can anyone help me out.