0

I have a server running Linux hosting a website. It uses ufw as a firewall. I have ports 80 and 443 open to external traffic. This all works.

Now what I want to do is allow any traffic from my laptop on the same subnet so that I can connect via SSH and administer MySQL from my laptop on the LAN.

I have added a rule in ufw to allow everything from my laptop (192.168.1.10) to the server (192.168.1.20). This should allow my laptop to connect via port 22 so that I can use SSH...but it doesn't.

If I turn ufw off I can connect so this IS a firewall issue not a connectivity or SSH server issue.

If I re-enable ufw the allow traffic on port 22 from ANYWHERE, I can connect from my laptop.

I've tried allowing port 22 from just my laptop.

What am I doing wrong? How do I "lock" port 22 down so that only my laptop can access it?

Thanks in advance.

2
  • How do you reach your server from the local network? Through a switch or through a router/NAT … Trace your connection to know … Your server might see the connection from your laptop as from a different source than what you assume.
    – Raffa
    Commented Dec 24, 2023 at 8:45
  • Thanks Raffa. It's just using a normal broadband "router" so a combined router and switch. I would have thought the laptop and server would communicate straight across the switch as they are on the same subnet. You might be on to something though.... Commented Dec 24, 2023 at 20:43

0

You must log in to answer this question.

Browse other questions tagged .