Search code examples
sshraspberry-piipwifi

Can't ssh into Raspberry Pi via Wifi. No problem with hotspot


When i try to connect my Raspberry Pi 3 B+ via ssh I get error.

  1. I get the IP from sudo nmap -sn 192.168.0.0/24, executed from my laptop

Nmap scan report for 192.168.0.100

Host is up (0.094s latency).

MAC Address: MAC (Raspberry Pi Foundation)

  1. Both devices are connected to my wifi.
  2. when i run ssh pi@192.168.0.100 The response is ssh: connect to host 192.168.0.103 port 22: No route to host

note: I dont have device with IP 192.168.0.103

note: the IP from the ssh command and the error response are different

note: When the same commands are executed, but this time via hotspot, the ip of the RPi changes and I use the new ip in the ssh and the connection is made without problem


Solution

  • Try deleting known_hosts file in .ssh folder from system which you are trying to ssh. Try again with correct IP address or you can also use ssh <username>@raspberrypi.local replace your username

    Edit : New Raspberry Pi OS does not come with default username and password. It needs to be configured before flashing in Raspberry Pi Imager itself.