How-To: Add Additional FTP Users to Domain in Plesk · Tuesday January 29, 2008

Assuming you already have an existing domain setup (example.com) with the primary FTP user (john) and password (doe) with home directory (/var/www/vhosts/domain.com), and you wish to create additional FTP users (jack and jill) with the same access privileges as john:

# Login to the server as root
ssh root@domain.com

# Execute the following shell command for the user’s account you wish to mimic
cat /etc/passwd | grep 'john'

This will show you a line similar to the following:

john:x:10041:2523::/var/www/vhosts/example.com:/usr/local/psa/bin/chrootsh

The first number (after the second colon) is 10041, so this is the UID of user “john”. You will need this in the useradd lines since useradd wants a number for the UID.

# Create an additional FTP user with a “jailed” home directory in /httpdocs directory
/usr/sbin useradd -u 10041 -o -d /var/www/vhosts/example.com -g psacln -s /usr/local/psa/bin/chrootsh jack

# Create an additional FTP user with a “jailed” home directory in /web_users directory
/usr/sbin useradd -u 10041 -o -d /var/www/vhosts/example.com/web_users -g psaserv -s /usr/local/psa/bin/chrootsh jack

# Give the user a password
passwd jack

Even without stopping/restarting the FTPd daemon, you should now be able login as with the new FTP user (jack) and access the same directories and with the same permissions as the primary domain user (john).

All new FTP accounts created using this method should have the same “shared” access to files since they all belong to the same group — no matter which of the users created or edited the file(s), all should be able to access/edit/whatever the same files.

As an additional benefit, the new user account is “jailed” to his/her home directory and cannot view the contents of other directories outside their home directory.

The only caveat to this aproach is that these users defined at the Operating System level, so their accounts or passwords cannot be changed through Plesk — but it’s a trade-off most people will glady accept for the improved functionality.

# To delete a user account
userdel jack

For a discussion on this topic, see http://forum.swsoft.com/pda/index.php/t-37495.html

— Ryan J. Bonnell

---