2

I am trying to enable SSH access to my home server via SSH from a public IP address. But the SSH server is not responding to requests from a public IP address. Connections from a local IP work fine.

I have set up port forwarding in the router, and I have allowed the connection both in the router firewall and the server iptables firewall.

In iptables, I have the following rule:

pkts bytes target     prot opt in     out     source               destination
117  7052  ACCEPT     tcp  --  any    any     anywhere             anywhere             tcp dpt:ssh

And I can see the 'pkts' field increment each time I try to establish a connection.

I can also see from WireShark that the server receives a TCP SYN packet on port 22, but there is no matching outgoing ACK packet.

I have also inspected /etc/ssh/sshd to make sure nothing is in there that would discriminate based on the IP address.

I have looked at the logs with journalctl, but they do not show anything when I try to make the connection. And I have tried running sshd manually with /usr/sbin/sshd -d, but there is no output when I try to make a connection.

Now I am stumped as to what the issue could possibly be. What else could block the connection based on the IP address?

DBear
  • 241

1 Answers1

0

Well, I found the issue, and it wasn't related to ssh at all. My server was configured with the incorrect gateway address, so it could not send packets to the WWW -- only to other machines on the LAN. Kind of a silly mistake, but it caused some behavior I did not expect. If I had been more observant in WireShark, I would have seen the server sending ARP packets searching for the wrong gateway.

DBear
  • 241