When you create a subscription or hosting in Plesk, a general FTP account is generated for that domain, but on a Linux Server it is not possible to add additional users, or point them to a specific folder, from the same Plesk control panel.
In this guide, we will assume the following data to make the procedure easier to understand:
- In Plesk there is the domain example.com
- The primary FTP username of example.com is user
- This user has the password password
- This user has as default root directory /var/www/vhost/example.com
- You want to configure two additional FTP users, user1 and user2, with the same privileges as user, but one of them will point to another folder
Warning
Remember that you must replace example.com, user, password, /var/www/vhost/example.com, user1 and user2 with your own domain data and the users you want to configure.
Steps to configure these additional FTP users
-
Access your server via SSH as user “root”
Additional information
You can find more information about accessing your server via SSH in the article: -
Run the command:
cat /etc/passwd | grep ‘user’
-
This command should show you a line similar to the following:
user:x:10041:10001::/var/www/vhosts/example.com:/bin/false
The first number (10041) is the UID of the user, and you must copy it because it is necessary to create the new users with the same UID.
-
Run the following commands to create the users user1 with the same home directory as the main domain user, and user2 with /var/www/vhosts/example.com/folder1 as the home directory:
useradd -u 10041 -o -d /var/www/vhosts/example.com -g psacln -s /bin/false user1
useradd -u 10041 -o -d /var/www/vhosts/example.com/folder1 -g psacln -s /bin/false user2 -
Once the new users have been created, it is advisable to use the following command to set their passwords:
passwd user1 xxxxxxxxx
passwd user2 xxxxxxxxxNote
Remember to replace “xxxxxxxxx” with the password you want to set.
Security tip
It is always safer to define a password as complex as possible, otherwise it may represent a serious security hole. You can find some advice on secure passwords in the article:
If you still have any questions that this article does not fully resolve, remember you can always contact our support.