Limit /admin acccess by ip

Business solution to host your own OpenVPN server with web management interface and bundled clients.
Post Reply
namit
OpenVpn Newbie
Posts: 1
Joined: Tue Apr 07, 2020 12:42 pm

Limit /admin acccess by ip

Post by namit » Tue Apr 07, 2020 12:44 pm

Hi all,

Just wondering if anyone know easy to to limit access to the /admin control panel by external ip address like an iptable room or htaccess file.

Thanks appreciate any input.

nehakakar
OpenVpn Newbie
Posts: 11
Joined: Tue Jul 11, 2023 1:29 pm

Re: Limit /admin acccess by ip

Post by nehakakar » Tue Jul 11, 2023 7:28 pm

Hi Namit,
Yes you can block on both IPTables or an .htaccess file.
Using IPTables you can run the following command to allow access from a specific IP address and block all others.

Code: Select all

iptables -A INPUT -p tcp --dport 80 -s YOUR_IP_ADDRESS -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j DROP
Save the IPTables rules to persist across reboots
iptables-save > /etc/iptables/rules.v4

Then Restart the IPTables.
systemctl restart iptables

____________________

On .htaccess here how you can block.

Code: Select all

order deny,allow
deny from all
allow from YOUR_IP_ADDRESS
Both methods will restrict access
Good luck

Post Reply