• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

How To: Add Secure Shell Access for web_users

C

cgraham149

Guest
Adding Secure Shell Access for web_users under 1 domain

+++ I do not know if this is SECURE / SAFE - but it worked for my purposes +++

Step 1:
Login as: root (I use WinSCP).
Navigate to: /usr/libexec/
Download: /usr/libexec/openssh/ (whole directory - containing sftp-server & ssh-keysign)

Step 2:
Navigate to: /home/httpd/vhosts/chroot/usr/libexec
Upload openssh dir (containing sftp-server & ssh-keysign) - make sure permission are set to 0755 on sftp-server and 0711 on ssh-keysign

Step 3:

Use Plesk to create new web_user: user1


Step 4:

Shell Login as: root (I use PuTTy)

Issue the following comand (modify domain as needed):

/usr/local/psa/admin/bin/chrootmng --create --source=/home/httpd/vhosts/chroot --target=/home/httpd/vhosts/domain.com/web_users/user1

Step 5:

Still using WinSCP as root...

Navigate to: /etc
Right click on passwd file and choose edit
New web_user entry should be last on the list and looks like this:

user1:x:10004:10001::/home/httpd/vhosts/domain.com/web_users/user1:/bin/false

Change /bin/false to /usr/local/psa/bin/chrootsh so it looks like this:

user1:x:10004:10001::/home/httpd/vhosts/domain.com/web_users/user1:/usr/local/psa/bin/chrootsh

Save file

Copy 1st part of above like this:

user1:x:10004:10001::

Step 6:

Navigate to: /home/httpd/vhosts/domain.com/web_users/user1/etc
Right click on passwd file and choose edit
Paste user1:x:10004:10001:: and add this /:/bin/bash - it should look like this:

user1:x:10004:10001::/:/bin/bash

Save file

Web_user now has secure shell access to his own directory. He can also SFTP or FTP to that directory but is locked down and can not move up into higher directories!!

Step 4 will copy all files and folders in chroot to the web_user directory, including:

bin, lib, tmp, var

I think it is ok to remove those directories and probably should as they may pose a security risk.
 
One moment - is there really no way under Plesk to create shell access for domain administrators or web users using the gui?
 
Originally posted by akucharski
One moment - is there really no way under Plesk to create shell access for domain administrators or web users using the gui?

You can create shell access for a single Domain user but not for multiple web_users under the same domain.
 
Back
Top