5

I install OpenVPN on my server following this guide --> https://www.digitalocean.com/community/tutorials/how-to-set-up-an-openvpn-server-on-ubuntu-14-04

I also setup a firewall with ufw where I add rule to allow ssh connection only from my interal IP assign to me after the VPN is Active.

I cannot connect to my server with this configuration, with or without VPN. What can I do to configure the network to allow ssh connection ONLY over VPN tunnel?

jack_0
  • 51
  • 1
  • 3
  • For ufw, see also https://www.cyberciti.biz/faq/ufw-allow-incoming-ssh-connections-from-a-specific-ip-address-subnet-on-ubuntu-debian/ – ferdymercury Jan 20 '22 at 10:36

1 Answers1

1

You can control it using the ListenAddress directive available in your ssh daemon config file

Something Like

sudo nano /etc/ssh/sshd_config

Reach the line:

#ListenAddress 0.0.0.0

Uncomment if necessary, and edit it accordingly to your vpn configuration, something like:

ListenAddress 10.10.0.1

Restart the daemon

sudo service ssh restart

Check if it works

Keep in mind you can also tune your firewall rules to further restrict access to certain subnet / ports, in this case your vpn network

Hope it helps

Entanglement
  • 71
  • 1
  • 4