I have a RaspberryPi running Ubuntu 20.04 Server and I want to connect to it from my Ubuntu 20.04 desktop machine via ssh. Usually I have my Pi connected to my router at home via ethernet and I can connect to it via ssh from my desktop machine which is connected to the router by WiFi without any problems.
Today I took the raspberry to work and since I can't connect it to WiFi here, I brought an ethernet cable to connect the desktop and the Pi directly. However now I struggle to connect to it over the ethernet connection.
In my normal setup I use
ssh ubuntu@raspberryfly
to connect to it, but with the direct ethernet connection this yields ssh: Could not resolve hostname raspberryfly: Temporary failure in name resolution
.
I configured my ethernet adapter's IPv4 method to "share to other computers", because I read that in some tutorial on this topic, I found on google. The IP adress that my ethernet adapter seems to use is 10.42.0.1. So I guessed, the raspberry might use 10.42.0.2. When I ping 10.42.0.2
I get From 10.42.0.1 icmp_seq=2 Destination Host Unreachable
. When I run nmap -p22 10.42.0.2
I get
Starting Nmap 7.80 ( https://nmap.org ) at 2021-09-01 12:49 CEST
Stats: 0:00:01 elapsed; 0 hosts completed (0 up), 1 undergoing Ping Scan
Ping Scan Timing: About 50.00% done; ETC: 12:49 (0:00:01 remaining)
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 3.03 seconds
So I followed nmap
's suggestion and used nmap -p22 10.42.0.2 -Pn
which yields
Starting Nmap 7.80 ( https://nmap.org ) at 2021-09-01 12:49 CEST
Nmap scan report for 10.42.0.2
Host is up.
PORT STATE SERVICE
22/tcp filtered ssh
Nmap done: 1 IP address (1 host up) scanned in 2.05 seconds
Does anyone have a suggestion, how I can ssh into the pi now?