Question
How to change Access to the server over SSH (shell) option that is defined in Plesk > Domains > example.com > Web Hosting Access for all/multiple subscriptions via CLI?
Answer
Note: the changes below will be done on a subscription level, all additional domains and subdomains inherit subscription’s settings.
- Log into the server via SSH.
- Create the list of all subscriptions:
# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin psa -Ne”select name from domains where id in (select object_id from Subscriptions)” > list.txt
Note: using text editor, exclude the unnecessary subscriptions from the created
list.txt
file - Execute the command below to apply the new Access to the server over SSH policy for all subscriptions from the
list.txt
file:# cat list.txt | while read i; do plesk bin subscription -u $i -shell /bin/bash; done
Note: in the example above the shell is set as
/bin/bash
, replace with the required.
To see aditional variants of shell, click here
/bin/sh
/bin/bash
/sbin/nologin
/usr/bin/sh
/usr/bin/bash
/usr/sbin/nologin
/bin/tcsh
/bin/csh
/bin/rbash
/usr/local/psa/bin/chrootsh
Note: to set Access to the server over SSH as Chrooted, use the shell above.
/bin/false
Note: to set Access to the server over SSH as Forbidden, use the shell above.