Can't Connect to My Ssh Server?

I tried for the first time to setup a ssh server following these steps on the server machine:

  1. Following this article, I installed sudo apt install openssh-server
  2. Following this question, I edited /etc/ssh/sshd_config and appended
    Port 22
    PermitRootLogin no
    AllowUsers usr
    
  3. Following the first article, sudo systemctl restart sshd.service
  4. Following this article I found my external IP address ip-add using this
  5. I tried to ssh from my server machine to the machine itself with ssh usr@ip-add

However I got this error message:

ssh: connect to host ip-add port 22: Connection refused
12

1 Answer

I solved the problem by creating a port-forwarding on my router.

3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Sarah Jenkins

Sarah Jenkins

Senior Technology Editor & AI Specialist

Sarah Jenkins is a veteran tech journalist with over 12 years of experience covering artificial intelligence, mobile innovations, and digital ethics. Her insights have appeared in leading technology publications worldwide.

Share this article
Twitter Facebook Pinterest