3

SD card in Pi3B number one - no problem.

Swap that same SD card to Pi3B number two:
- Connection refused when trying to ssh from another computer.
- No problem pinging the Pi at its new ip (assigned by dhcp) and no significant latency.
- Nmap says 0 ports are open.

Where do I start troubleshooting this? What could be causing ssh to run perfectly fine on one device but shut down on another? Obviously they have different MAC and this dhcp assigns different ips. How could this affect ssh?

Running raspbian Jessie.

  • Start with checking the log for errors with systemctl status ssh. Add it to the question if it's something 'interesting'. – Dirk Nov 25 '18 at 22:55
  • To start troubleshooting connect to both devices using ssh -vvv [username]@[ipv4] -p [portnumber] (replace values in square brackets, default portnumber is 22). Btw: your SD card is probably fine. Did you run Nmap with root privileges? – Fabian Nov 26 '18 at 18:34
2

I've had an issue with similar symptoms. The dhcp server assigns an IP address to the 'new' (second) pi but the original lease is still on on the sd card and not changed.

There's an answer here: How to make dhclient forget its last DHCP lease?

The suggestion is to clear the lease on the pi:

sudo dhclient -r -v eth0 && rm /var/lib/dhcp/dhclient.* ; dhclient -v eth0

For me this often (but not always) worked.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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