I have a raspberrypi3 connected to my home network via ethernet cable. I am trying to access it via ssh from a laptop connected to the same network over wi-fi.
I enabled ssh on the pi's user (which has a different name than the default
pi). When I try to connect with
ssh <user>@<ip-address> I still get
ssh: connect to host <ip-address> port 22: No route to host
Could it be because the pi is connected to the home network via ethernet? Or should I set something in the router?
I tried to pin the pi's ip address and this is what I get
64 bytes from 192.168.1.102: icmp_seq=371 ttl=64 time=2.46 ms 64 bytes from 192.168.1.102: icmp_seq=372 ttl=64 time=2.04 ms 64 bytes from 192.168.1.102: icmp_seq=373 ttl=64 time=2.17 ms 64 bytes from 192.168.1.102: icmp_seq=374 ttl=64 time=3.77 ms etc. etc.
Which makes me think the laptop and pi are indeed connected.
p.s: I also created an empty
ssh file in
I did some additional testing. I connected the raspberry via wi-fi and ssh works correctly. I then disconnected from wi-fi by commenting out the lines regarding my ssid and psw in
/etc/wpa_supplicant/wpa_supplicant.conf. I connected the raspberry via ethernet cable and can see its internal IP in the page of my router. I use
ssh <user>@<ip-address> -vv and this is what I get:
OpenSSH_7.2p2 Ubuntu-4ubuntu2.2, OpenSSL 1.0.2g 1 Mar 2016 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 19: Applying options for * debug2: resolving "192.168.1.4" port 22 debug2: ssh_connect_direct: needpriv 0 debug1: Connecting to 192.168.1.4 [192.168.1.4] port 22. debug1: connect to address 192.168.1.4 port 22: No route to host ssh: connect to host 192.168.1.4 port 22: No route to host