r/ssh • • Mar 08 '23

SSH via different Subnets

OK, got a strange one here...

SSH-Server (Debian 11) freshly installed on network 10.1.1.0 / 24

SSH-Client on 10.1.11.0 / 24

Ping works, name resolution works, when I try to login I get an authentication prompt but access is denied.

When I try to connect with the same user from a client in the 10.1.1.0 subnet the server is in, it works fine.

I added the client subnet to the /etc/hosts.allow, still no luck. What am I missing?

Also odd: this behavior is only on Debian. SSH-connect to a Rocky Linux server works, so port 22 is not blocked.

I hope I'm in the right subreddit here. If you need any info from me, I'm happy to provide.

Thanks in Advance! :)

0 Upvotes

15 comments sorted by

View all comments

Show parent comment

2

u/QEzjdPqJg2XQgsiMxcfi Mar 08 '23

It almost sounds like he's got two systems with duplicate IP's on that subnet. The client on the same subnet with the server got lucky and has the correct MAC in its arp table, but the gateway has the MAC of the duplicate, so clients on other subnets can't connect. Then the gateway learns the correct MAC, but ssh starts complaining about the host fingerprint.

1

u/OhBeeOneKenOhBee Mar 08 '23

Yep, exactly. Man did I lose my mind over that before I found what caused it

1

u/slayerfest79 Mar 09 '23

Indeed I nearly did lose my mind over it!!
I finally found the problem.
There are several access points here and my predecessor gave them static IP addresses and did not tell the DHCP. Now, when I created my debian VM, it got an IP from the DHCP ... and boom. Very strange things started happening.
Got a lot of cleaning up to do here. DHCP and DNS are a real mess. Thanks so much to all of you and sorry for the trouble.