Applicable to:
- Plesk for Linux
- Plesk for Windows
Question
How to restrict Administrator access to Plesk GUI from the specific IP address via CLI?
Answer
Currently, there is no such functionality in Plesk.
If you would like to see this feature in Plesk, please vote for it on Plesk UserVoice portal:
The top-ranked suggestions are likely to be included in the next versions of Plesk.
As a workaround, such a task can be performed by executing the corresponding SQL queries.
-
Log into the server via SSH.
-
Create a backup of the psa database:
# plesk db dump psa > /root/psa.sql
-
Run the command below to set the deny policy:
# plesk db "INSERT INTO misc (param,val) VALUES ('access_policy','deny')"
-
Note: in case the output of the command will be as below:
CONFIG_TEXT: ERROR 1062 (23000) at line 1: Duplicate entry 'access_policy' for key 'PRIMARY'
Change the command to the following:
# plesk db "UPDATE misc SET val='deny' WHERE param='access_policy'"
-
-
Execute the command below to allow Administrator access to Plesk only from the
203.0.113.2
IP address:# plesk db "INSERT INTO cp_access (type, netaddr, netmask) VALUES ('deny', '203.0.113.2', '255.255.255.0')"
-
Log into the server via RDP.
-
Create a backup of the psa database:
C:\> plesk db dump psa > C:\psa.sql
-
Run the command below to set the deny policy:
C:\> plesk db "INSERT INTO misc (param,val) VALUES ('access_policy','deny')"
-
Note: in case the output of the command will be as below:
CONFIG_TEXT: ERROR 1062 (23000) at line 1: Duplicate entry 'access_policy' for key 'PRIMARY'
Change the command to the following:
C:\> plesk db "UPDATE misc SET val='deny' WHERE param='access_policy'"
-
-
Execute the command below to allow Administrator access to Plesk only from the
203.0.113.2
IP address:C:\> plesk db "INSERT INTO cp_access (type, netaddr, netmask) VALUES ('deny', '203.0.113.2', '255.255.255.0')"
Comments
0 comments
Please sign in to leave a comment.