0

I have two laptops having Ubuntu 14.04 LTS. I have connected both of them to same wireless network.Now I have installed ssh server on Ubuntu.Now I am trying to access other laptop's ( say B) desktop but error is coming like

    Ssh:connect to host 192.168.0.102 port 22: No route to host

I am using following command

    ssh user@192.168.0.102

The following is the output for ifconfig

     eth0      Link encap:Ethernet  HWaddr 28:92:4a:1e:eb:ed  
      UP BROADCAST MULTICAST  MTU:1500  Metric:1
      RX packets:0 errors:0 dropped:0 overruns:0 frame:0
      TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

     lo        Link encap:Local Loopback  
      inet addr:127.0.0.1  Mask:255.0.0.0
      inet6 addr: ::1/128 Scope:Host
      UP LOOPBACK RUNNING  MTU:65536  Metric:1
      RX packets:614 errors:0 dropped:0 overruns:0 frame:0
      TX packets:614 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:0 
      RX bytes:53218 (53.2 KB)  TX bytes:53218 (53.2 KB)

      wlan0     Link encap:Ethernet  HWaddr 08:3e:8e:0e:4f:4b  
      inet addr:192.168.0.100  Bcast:192.168.0.255  Mask:255.255.255.0
      inet6 addr: fe80::a3e:8eff:fe0e:4f4b/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:1412 errors:0 dropped:0 overruns:0 frame:13931
      TX packets:1931 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:557138 (557.1 KB)  TX bytes:240606 (240.6 KB)
      Interrupt:17 

The following happens when I do ping

      PING 192.168.0.102 (192.168.0.102) 56(84) bytes of data.
      From 192.168.0.100 icmp_seq=9 Destination Host Unreachable
      From 192.168.0.100 icmp_seq=10 Destination Host Unreachable
      From 192.168.0.100 icmp_seq=11 Destination Host Unreachable
      From 192.168.0.100 icmp_seq=12 Destination Host Unreachable
      From 192.168.0.100 icmp_seq=13 Destination Host Unreachable
      From 192.168.0.100 icmp_seq=14 Destination Host Unreachable
      From 192.168.0.100 icmp_seq=15 Destination Host Unreachable
      From 192.168.0.100 icmp_seq=16 Destination Host Unreachable
      From 192.168.0.100 icmp_seq=17 Destination Host Unreachable
      From 192.168.0.100 icmp_seq=18 Destination Host Unreachable
      From 192.168.0.100 icmp_seq=19 Destination Host Unreachable
      From 192.168.0.100 icmp_seq=20 Destination Host Unreachable
      From 192.168.0.100 icmp_seq=21 Destination Host Unreachable
      From 192.168.0.100 icmp_seq=22 Destination Host Unreachable
      From 192.168.0.100 icmp_seq=23 Destination Host Unreachable
      From 192.168.0.100 icmp_seq=24 Destination Host Unreachable
      From 192.168.0.100 icmp_seq=25 Destination Host Unreachable
      From 192.168.0.100 icmp_seq=26 Destination Host Unreachable
      From 192.168.0.100 icmp_seq=27 Destination Host Unreachable
      From 192.168.0.100 icmp_seq=28 Destination Host Unreachable
      From 192.168.0.100 icmp_seq=29 Destination Host Unreachable
      From 192.168.0.100 icmp_seq=30 Destination Host Unreachable
      From 192.168.0.100 icmp_seq=31 Destination Host Unreachable
      From 192.168.0.100 icmp_seq=32 Destination Host Unreachable
      and so on.....

Output of netstat -rn

      Kernel IP routing table
      Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
      0.0.0.0         192.168.0.1     0.0.0.0         UG        0 0          0 wlan0
      192.168.0.0     0.0.0.0         255.255.255.0   U         0 0          0 wlan0
  • can you ping the other machine? – Mehdi Apr 6 '16 at 9:08
  • What's your ifconfig command output? – Mahdi Apr 6 '16 at 9:11
  • @Mehdi I did pin. Please see the edited question – vipin megotia Apr 6 '16 at 9:34
  • @Mahdi a I did ifconfig. Please see the edited question – vipin megotia Apr 6 '16 at 9:35
  • Test what is said here: askubuntu.com/questions/462643/… – Mahdi Apr 6 '16 at 10:05
0

Maybe you need to disable the firewall ... You can check if the ssh-server is working and listening the network by using nmap (need to install it first):

apt-get install nmap -y

nmap -p22 192.168.0.102

You need to see something like that which indicate that the port 22 (ssh port) is open:

root@srkv12b3:/home/monitor# nmap  -p22 192.168.19.4
Starting Nmap 7.01 ( https://nmap.org ) at 2016-04-06 11:08 CEST
Nmap scan report for 192.168.19.4
Host is up (0.000033s latency).
PORT   STATE SERVICE
22/tcp open  ssh

Nmap done: 1 IP address (1 host up) scanned in 5.79 seconds
| improve this answer | |
  • Following output i got: Starting Nmap 6.40 ( nmap.org ) at 2016-04-06 15:16 IST Note: Host seems down. If it is really up, but blocking our ping probes, try -Pn Nmap done: 1 IP address (0 hosts up) scanned in 0.44 seconds – vipin megotia Apr 6 '16 at 9:47

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.