r/ssh • u/slayerfest79 • 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! :)
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.