How do I allow only my VPN ip address to access SSH on the same server?

Hello, I have a problem with whitelisting my vpn ip address in the linode cloud firewall. I have the following ip: 1.2.3.4 (fake). I add an accept inbound TCP rule:

Protocol: TCP
Ports: SSH 22
Sources: Ip / netmask
Ip / netmask: 1.2.3.4/32

The public ip address (1.2.3.4) is from my OPENVPN VPS server, which is the same server as where I try to get SSH access to. When I create an accept inbound I cannot connect to SSH.

I want my computer to be connected to the OPENVPN server before I can access SSH on that server.

BTW: I have OPENVPN working by creating a rule for UPD 1194. That connection is working fine.

1 Reply

I got it working by allowing:

211.0.0.0/8 # last access vpn through ssh ip range
172.0.0.0/8 # vpn ip range
89.0.0.0/8 # home ip range

211.*.*.* is what I get when I lookup the last ip address who accessed the server through ssh.

It is not as specific as I would like, but it is better than nothing.
So the question remains, how to whitelist only the vpn ip?

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct