0

I connected to Ubuntu server from my Mac terminal using ssh [email protected] (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 [email protected] -p 55555, then I got the message [email protected]: 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.

5
  • 1
    "Permission denied (publickey)" suggests that you DID connect to port 55555. You were refused entry due to incorrect login. Try again using ssh -v [email protected] -p 55555 for more useful diagnostic output.
    – user535733
    Nov 6, 2022 at 14:29
  • 1
    Is the server on the same LAN as the MAC? if not, you likely need to change the port forwarding settings on the server network's router if you want to use a different external port number Nov 6, 2022 at 14:42
  • FYI you are not going to be able to login as root on a default Ubuntu system. That's disabled by default, and since the root password is not set you need to use SSH public key authentication to login to root by default. You should SSH in as a non-root sudo-enabled account and then use sudo on your sudo-enabled account to execute commands as admin.
    – Thomas Ward
    Nov 6, 2022 at 18:26
  • Does this answer your question? SSH Permission denied (publickey) Nov 15, 2022 at 7:47
  • 1
    @Dan I think you have to see the IP address as an abstraction in the question.. I understand why the OP doesn't want to show his real public IP and port here. Nov 15, 2022 at 8:00

0

You must log in to answer this question.

Browse other questions tagged .