0

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?

7
  • Your assumptions are wrong. If your RaspberryPi is not configured with a static IP it is waiting for DHCP. By sharing the adapter you might enable DHCP in some form. If you are on a company network and a company issue device your IT department might've put limitations in place. In addition, depending on which way around you're sharing, you might also simply be sharing the wrong adapter.
    – Seth
    Commented Sep 1, 2021 at 11:22
  • @Seth Well, the default was DHCP. So first I tried to use DHCP and it didn't work. So I made some research on google, and I read, that I should use "share to other computers". So I tried that and it's not working either. Computer and Pi are not from the company. My computer is logged in to company wifi, but that's unrelated to the issue I guess, since I'm trying to connect to the Pi via ethernet. What do you mean by "sharing the wrong adapter"? And what do you mean by "which way around you're sharing"?
    – Max
    Commented Sep 1, 2021 at 12:16
  • It does sound like you're using ICS. So you're sharing the selected adapater with another interface. Your Notebook is supposed to act like a gateway/router. So you do have a working internet connection and you are trying to make that accessible to a different device. In the past it was possible to make this work the wrong way around. Your Raspberry Pi, depending on configuration, might also be using an APIPA address. You could try to disconnect from the WLAN and just try to use NMAP to scan the appropiate address ranges for a host that's alive. Assuming DHCP did work or an APIPA is used.
    – Seth
    Commented Sep 1, 2021 at 12:26
  • @Seth Wait, I feel like there is a missunderstanding here. My primary goal is not to share my notebook's internetaccess with the pi. My primary goal is, to be able to access the pi via ssh.
    – Max
    Commented Sep 1, 2021 at 12:33
  • But I will try to disconnect from wifi now and see, what's happening then.
    – Max
    Commented Sep 1, 2021 at 12:33

0

You must log in to answer this question.

Browse other questions tagged .