Score:1

unable to SSH but successfully pinging

ky flag

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.

guiverc avatar
cn flag
You haven't said if this is a Ubuntu 20.04 LTS server or desktop install? ie. do you have `openssh-server` running on it? or only a client (as is default with desktop installs; ie. you can `ssh` out, but not in)
ky flag
I have ```linux-image-5.4.0-89-generic``` as kernel. Can I implement ```openssh-server``` on it?
ky flag
i installed openss-server and now it is remotely connecting through SSH. Thanks for your help.
Score:1
cn flag

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

Score:0
cz flag

You could try to use nmap or any other tool to double check if port 22 is really open.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.