Hello,
NOTE: This howto was adopted from a post on forum.sw-soft.com.
It is required to use the shell since the Plesk control panel won't allow it in the GUI.
Assume you already have an existing domain (example.com) with the primary FTP user (duser) with with home directory (/var/www/vhosts/example.com), and you wish to create an additional FTP user duser1 with access to a subfolder within the example.com's document root, i.e. /var/www/vhosts/example.com/httpdocs/subfolder.
Procedure:
Login to server via SSH as root and issue the shell command:
cat /etc/passwd | grep duser
This will show you a line similar to the following:
duser:x:10041:10001::/var/www/vhosts/example.com:/bin/false
The first number (after the 2nd colon) is 10041, so this is the UID of user duser. You will need this in the 'useradd' lines since useradd wants a number for the UID.
Then do the following shell commands to create the user and specify a password for him:
useradd -u 10041 -o -d /var/www/vhosts/example.com/httpdocs/subfolder -g psacln \
-s /bin/false duser1
passwd duser1
(enter the new password and confirm it, does not have to be the same as duser's)
You should now be able to use a FTP client to login with that duser1's name and password.
You should NOT be able to browse above the /var/www/vhosts/example.com/httpdocs/subfolder directory which was setup as the home folder of duser1 in useradd. If you need to create an additional user with the same FTP access as duser has, you need put /var/www/vhosts/example.com as the home folder.
For more information on the shell utilities used above, issue:
man useradd
man passwd
NOTES: Since these are users defined at the OS level, when connecting with an FTP client, they must login with username 'duser1'. They can NOT use '
duser1@example.com'. This also means that USERNAMES MUST BE UNIQUE.
Deleting a sub FTP user:
userdel duser1
(NOTE: this will not delete any files unless you use the -r option which you probably don't want to do if they are sharing files!)
I hope this post is helpful.