• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Add Limited FTP Accounts like cPanel

I

industriality

Guest
I've been a user of cPanel for awhile and just switched to a host who uses Plesk instead.

cPanel has an easy way for me to set up a new FTP account that limits access to a subfolder. Example: I could create a new FTP user who can login using this username in full: [email protected]. Once logged in, their root folder will appear as mydomain.com/uploads/ They have complete upload/rename/delete access for that folder and all child folders, but they cannot access the root of the domain.

Plesk has a somewhat similar function called "Web Users", but it does not allow scripting and inserts a mandatory "~" character before the folder name.

Since cPanel can do what I've described, why can't Plesk? Is there a way to do this on a server manually that uses Plesk? Is there some kind of work-around to achieve this functionality?

Thanks.
 
HOWTO - manual creation of FTP users

I sure hope this helps all those out there who have asked this question many times....

Code:
HOWTO: Procedure to manually add additional domain FTP users on a Plesk Server. (JYee)

Using the shell since the Plesk control panel won't allow it in the GUI.
See notes at bottom for subdomain FTP users.

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

Procedure:

Login to server via SSH as root.

Issue the shell command:
        cat /etc/passwd |grep 'jack'

This will show you a line similar to the following:
        jack:x:10041:10001::/home/httpd/vhosts/example.com:/usr/local/psa/bin/chrootsh

The first number (after the 2nd colon : ) is 10041, so this is the UID of user jack.
You will need this in the 'useradd' lines since useradd wants a number for the UID.

The second number (after the 3rd colon : ) is 10001, this is the GID (psacln), we won't need that right now.

Then do the following shell commands to create the users and passwords:
        useradd -u 10041 -o -d /home/httpd/vhosts/example.com -g psacln -s /usr/local/psa/bin/chrootsh jill
        useradd -u 10041 -o -d /home/httpd/vhosts/example.com -g psacln -s /usr/local/psa/bin/chrootsh bob
        passwd jill  (enter the new password and confirm it, does not have to be the same as jack's)
        passwd bob  (enter the new password and confirm it, does not have to be the same as jack's)

You should now be able to use an FTP client to login with that user's name and password.
User jill and bob should be able to see the example.com docroot just as user jack can.
You should NOT be able to browse above the example.com docroot directory.

All 3 users should have the same access to the files since they belong to the same group, so no matter
which of the users created or edited the file(s), all should be able to access/edit/whatever the same files.

For more information on the shell utilities used, use:
        man useradd
        man passwd

NOTES:

Since these are users defined at the OS level, when connecting with an FTP client, they would login with
username 'jill', 'bob', or 'jack'.  They would NOT use '[email protected]'.

This also means that USERNAMES MUST BE UNIQUE.


Subdomain FTP users:

If you wanted to change their default directory and limit them to a Plesk created subdomain docroot,
in the useradd line above, you would change "/home/httpd/vhosts/example.com" to 
"/home/httpd/vhosts/example.com/subdomains/subname".  So if you wanted to create the same users, but
for a subdomain called 'awesome':

Then do the following shell commands to create the users and passwords:
        useradd -u 10041 -o -d /home/httpd/vhosts/example.com/subdomains/awesome -g psacln -s /usr/local/psa/bin/chrootsh jill
        useradd -u 10041 -o -d /home/httpd/vhosts/example.com/subdomains/awesome -g psacln -s /usr/local/psa/bin/chrootsh bob
        passwd jill  (enter the new password and confirm it, does not have to be the same as jack's)
        passwd bob  (enter the new password and confirm it, does not have to be the same as jack's)

Deleting an FTP user:
	userdel jill

                (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!)

Note:  Plesk subdomains versus 4PSA subdomains:

        Plesk creates their subdomains in /home/httpd/vhosts/example.com/subdomains
        4PSA creates their subdomains in /home/httpd/vhosts/example.com/httpdocs/subdomains

        So keep this in mind for anyone using 4PSA Total Domains software!  You may need to adjust the paths in my examples.
I am not responsible for misuse or abuse of these procedures/commands. If you mess up your server, do not blame me!
 
Thank you so much for the quick response. I'll run this by my host to see if they can hook it up as described.
 
Perfect instructions, just what I needed to find. Thanks for taking the time to compile this for our benefit.

David
 
But an imperfect operator. I have followed the instructions and I still cannot login as the new user I just created using FTP. I get a password error. I did use the passwd command to set the password.

Any ideas on what to do next?

David
 
Special note, for those of you who may not have the experience or knowledge.. When using the "passwd" command, i.e. as mentioned above "passwd bob" and "passwd jill", you do NOT follow the phrase "passwd bob" with the password. You hit enter, then it'll ask for the pass. Give a few of those users on the forums that may not have the knowledge a bit of a heads up...
 
Multiple FTP Accounts

Great job, this worked when nothing else did.
 
This is Good BUT,

I need instructions like this for windows platform, but can't seem to find it. Any idea's?
 
You could try posting the question in the Plesk for Windows forum. This is the Linux forum
 
Hi,

what if someone, useing plesk webinteface, create user jill or bob. passwd file will be overwritten in this case ?

Is this method safe and works with plesk fine ?

Users jill and bob still are not added to psa database ...

--- edit ---
plesk check this in .passwd and do not allow to add this users :)

bye ;)
 
when I try this I get:
bash: useradd: command not found

..can anyone tell me if I've done something incorrectly or what it means?
thank you!
 
here's what I did:


[root@xuni heidixuni]# whoami
root
[root@xuni heidixuni]# adduser
bash: adduser: command not found
[root@xuni heidixuni]#


what next?
thanks in advance for your assistance!
 
hmm, what os is this ?

You can always tray to put this line at:
/etc/passwd

set the gid to psacln (10001)
for security reasons set :/bin/false

than do
passwd user

this should work ...
 
is unix plesk 7.5.4

..and sorry and barely a beginner at linux/unix commands so I'm not how to do what your wrote :(
 
Back
Top