0

What I did:

  1. Installed raspbian on my Pi3 and did touch ssh in boot folder before turning on the Pi and connecting the ethernet cable to my laptop's ethernet port.
  2. Went to Wired Connection > Setting > Ipv4 > share to other computers
  3. Used hostname -I to find the IP of my Pi, which is 10.42.0.1
  4. Ran ssh
ssh [email protected]
ssh: connect to host 10.42.0.1 port 22: Connection refused

  1. Ran nmap on the Pi IP
nmap 10.42.0.1
Starting Nmap 7.80 ( https://nmap.org ) at 2020-10-06 11:14 PDT
Nmap scan report for 10.42.0.1
Host is up (0.00011s latency).
Not shown: 999 closed ports
PORT   STATE SERVICE
53/tcp open  domain

Nmap done: 1 IP address (1 host up) scanned in 0.07 seconds

I've been told there is supposed to be a port that says SSH under service if SSH is enabled. I've created an ssh file with no extensions and it confirmed that it got deleted after boot, but I can't SSH into my Pi and can't see SSH under service.

EDIT: output of some commands

ip -br addr
lo               UNKNOWN        127.0.0.1/8 ::1/128 
enp7s0           UP             10.42.0.1/24 fe80::f3d5:2580:4f4e:ad4e/64 
wlp6s0           UP             10.0.0.142/24 2601:602:9202:5d00::e23a/128 2601:602:9202:5d00:594b:2b5f:40f4:9895/64 2601:602:9202:5d00:971c:2011:eb93:2b91/64 fe80::9513:67c4:4bfb:135a/64 

ip route
default via 10.0.0.1 dev wlp6s0 proto dhcp metric 600 
10.0.0.0/24 dev wlp6s0 proto kernel scope link src 10.0.0.142 metric 600 
10.42.0.0/24 dev enp7s0 proto kernel scope link src 10.42.0.1 metric 100 
169.254.0.0/16 dev wlp6s0 scope link metric 1000 

6
  • Don't know what you followed with the link. Where do you run the command hostname -I? On the Laptop?
    – Ingo
    Commented Oct 6, 2020 at 18:31
  • I followed the first answer that tells me to edit the connection setting. I don't think that part is the problem since I can see the pi ip. I ran hostname -I on my laptop.
    – Hamuel
    Commented Oct 6, 2020 at 18:54
  • If you setup ICS on your laptop you will be able to access the internet from your Pi BUT NOT ssh.
    – Milliways
    Commented Oct 6, 2020 at 21:55
  • You are using the wrong setup. Please edit your question and add the output of these commands on the laptop: ip -br addr and ip route.
    – Ingo
    Commented Oct 6, 2020 at 22:17
  • In the wired settings under ethernet it also says ipv4: 10.42.0.1, so I think it's the ip of the pi. My laptop's ip in my home network is 10.0.0.142.
    – Hamuel
    Commented Oct 6, 2020 at 22:17

1 Answer 1

3

As shown by the ip commands the wired connection with interface enp7s0 is using subnet 10.42.0.0/24 and the Laptop has ip address 10.42.0.1/24 on the wired port to the RasPi. If there is a DHCP-server available on the Laptop then the RasPi will have an ip address in the range 10.42.0.2 to 10.42.0.254. To find its ip address you should execute:

laptop ~$ nmap -sn 10.42.0.0/24

This will ping test the subnet and it always show you its own ip address 10.42.0.1 and it should in addition find the RasPis ip address if it has got an ip address from the Laptop. If not (no DHCP server available) then you should give the RasPi a static ip address or ensure that link local addressing is working on the Laptop. The link local address subnet is already available as shown by ip route:

169.254.0.0/16 dev wlp6s0 scope link metric 1000

but only on the WiFi interface wlp6s0.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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