I have a Ubuntu computer at home connected to the internet through a tp-link router. I want to access this computer ssh
from the internet through my laptop. (for example: access from school or office)
Here is what I set up:
Installed OpenSSH Server: I have installed the OpenSSH server on my Ubuntu computer and started the SSH service.
Ubuntu❯ systemctl status ssh● ssh.service - OpenBSD Secure Shell server Loaded: loaded (/usr/lib/systemd/system/ssh.service; enabled; preset: enabled) Active: active (running) since Fri 2024-08-02 10:55:21 CST; 1h 32min agoTriggeredBy: ● ssh.socket Docs: man:sshd(8) man:sshd_config(5) Process: 7281 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)Main PID: 7286 (sshd) Tasks: 1 (limit: 38118) Memory: 1.3M (peak: 3.7M) CPU: 73ms CGroup: /system.slice/ssh.service└─7286 "sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups"Aug 02 10:55:21 wanchuan-Ubuntu systemd[1]: Starting ssh.service - OpenBSD Secure Shell server...Aug 02 10:55:21 wanchuan-Ubuntu sshd[7286]: Server listening on :: port 22.Aug 02 10:55:21 wanchuan-Ubuntu systemd[1]: Started ssh.service - OpenBSD Secure Shell server.
Opened Firewall Port: I have opened the firewall for port 22, the default SSH port.
Ubuntu❯ sudo ufw statusStatus: activeTo Action From-- ------ ----22/tcp ALLOW Anywhere 22/tcp (v6) ALLOW Anywhere (v6)
Checked Public IP Address: I know the public IP address of my router.
Ubuntu❯ curl ifconfig.me123.456.789.000
- Configured Port Forwarding: I configured port forwarding on my router to forward incoming traffic on port 22 to my Ubuntu computer (IP assigned by router: 192.168.0.103).
Issue faced
Connecting via SSH: Tried connecting to my Ubuntu computer from my laptop using the public IP address of my router. Connection refused.
Laptop❯ ssh user@123.456.789.000 -p 22ssh: connect to host 123.456.789.000 port 22: Connection refused
Checking Port Availability: Used canyouseeme.org to check the availability of port 22. It is not available.
What might be causing this issue? What steps I might have missed or done incorrectly?
Thank you very much for your help.