I found myself wanting to create an extra FTP user for one of my Plesk machines that would only have access to a subdirectory of one of the machine’s domains.

It turns out this isn’t as tricky as I made it!

If you create a new OS user giving them the same user ID number as the primary FTP user and the Plesk group ‘psacln’, they have the same privileges. Giving them a home directory of the subdirectory instead of the primary user’s home directory chroots them inside it.. perfect.

1. Determine the uid number of the primary user (bob)


# cat /etc/passwd | grep bob
bob:x:10021:10001::/home/httpd/vhosts/bob.org:/bin/false

2. Create the new user with the same uid number, group, and shell (if you wish) but with a new home directory.

# useradd -u 10021 -o -d /home/httpd/vhosts/bob.org/httpdocs/bobs_subdir -g psacln -s /bin/false bob
# passwd bob

Give them a password and you’re done!

Thanks to this post on the SWSoft forums
http://forum.swsoft.com/showthread.php?postid=118777

Categories: LAMPPlesk

Jonathan Adjei

Jon's expertise in web development is legendary and he oversees all technical aspects of our projects from development to hosting (all through the command line!) Jon is excited by the latest techniques and keeps the company on track by finding ways to adopt new practices into our workflow.