Article ID: 118626, created on Nov 14, 2013, last review on Jun 19, 2016

  • Applies to:
  • Plesk 11.0 for Linux
  • Plesk 11.5 for Windows

Question

How to Restrict Plesk Administrative Access (Tools & Settings > Restrict Administrative Access) via the command line or API.

IP access restriction management

Resolution

Currently there is no possibility to manage this settings via API. Feature request number 1755420 has been created regarding the matter. However this could be done via CLI (see below).

Workaround

Use the 'admin' utility with the below options:

# /usr/local/psa/bin/admin --set-admin-access-restrictions rest.xml

Where rest.xml content should have the following format:

<?xml version="1.0" encoding="UTF-8"?>
        <admin-access-restrictions>
          <restriction-item ip-subnet-mask="255.255.255.255" ip-address="1.2.3.3" type="deny"/>
          <restriction-item ip-subnet-mask="255.255.255.255" ip-address="1.1.3.3" type="deny"/>
          <restriction-item ip-subnet-mask="255.255.255.255" ip-address="1.1.1.3" type="deny"/>
          <restriction-item ip-subnet-mask="255.255.255.255" ip-address="10.50.2.10" type="deny"/>
          <restriction-item ip-subnet-mask="255.255.255.255" ip-address="2.2.2.2" type="allow"/>
          <restriction-item ip-subnet-mask="255.255.255.255" ip-address="3.3.3.3" type="allow"/>
        </admin-access-restrictions>

Make sure that the access_policy parameters are set to allow specified in psa database:

# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin psa -e'update misc set val="allow" where param="access_policy"'
# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin psa -e'select * from misc where param="access_policy"'
+---------------+-------+
| param         | val   |
+---------------+-------+
| access_policy | allow |
+---------------+-------+

Search Words

Restrict Administrative Access CLI

restrict access for staff members

a914db3fdc7a53ddcfd1b2db8f5a1b9c 56797cefb1efc9130f7c48a7d1db0f0c aea4cd7bfd353ad7a1341a257ad4724a 29d1e90fd304f01e6420fbe60f66f838 0a53c5a9ca65a74d37ef5c5eaeb55d7f 46a8e394d6fa13134808921036a34da8 85a92ca67f2200d36506862eaa6ed6b8 bd7fc88cf1b01f097749ae6f87272128

Email subscription for changes to this article
Save as PDF