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.
Limit /admin acccess by ip
-
- OpenVpn Newbie
- Posts: 11
- Joined: Tue Jul 11, 2023 1:29 pm
Re: Limit /admin acccess by ip
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.
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.
Both methods will restrict access
Good luck
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
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
Good luck