unable to SSH but successfully pinging

I have configured a static IP in Ubuntu 20.04 i.e., 192.168.0.2, with DNS as 192.168.0.1, 8.8.8.8 and default route 192.168.0.1. Now, as I am pinging from other machine on the same network, it is successfully pinging, but when I am trying to connect from Putty it is showing connection refused. I have also checked my firewall for port 22 for allowing SSH connection.

This is my ifconfig result:

docker0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 172.17.0.1  netmask 255.255.0.0  broadcast 172.17.255.255
        ether 02:42:e3:21:32:80  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

enp6s0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether f0:4d:a2:30:48:b6  txqueuelen 1000  (Ethernet)
        RX packets 3678  bytes 313364 (313.3 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 6522  bytes 592090 (592.0 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 17  

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 27389  bytes 2387414 (2.3 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 27389  bytes 2387414 (2.3 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlx502b73e90726: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.2  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::522b:73ff:fee9:726  prefixlen 64  scopeid 0x20<link>
        ether 50:2b:73:e9:07:26  txqueuelen 1000  (Ethernet)
        RX packets 33137  bytes 15333492 (15.3 MB)
        RX errors 0  dropped 286  overruns 0  frame 0
        TX packets 21902  bytes 3714387 (3.7 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

I cannot figure out what is wrong here when I'm trying to SSH into the system using the static IP.


Solution 1:

Ubuntu 20.04 LTS is available in server & desktop form.

The desktop product includes the ssh client by default; meaning you can ssh into other boxes; but not ssh into the machine; after all a desktop system is generally used locally.

The server product is usually used remotely; thus includes the ssh server by default, allowing you to ssh into the machine.

If using a desktop system, you'll likely need to

apt install openssh-server