How to create additional ftp user using SSH?

How can I create additional ftp user using SSH and to give access only to a specified folder for example,

httpdocs/folder1/

Depends on the OS and what FTP server software it’s running. So the first step is getting the exact name and version of both of those things so that you know what to search for.

I have CentOS 5 VPS including Plesk.

  1. Log into Plesk.

    1. Click into the domain in which you want to add a protected directory

    2. Click the Directories icon under Hosting . This opens protected directories for the domain.

    3. To add a another FTP user account click Add New Directory and enter the name of the directory you wish the FTP account user to access into the Directory name field proceeded by a forward slash.

    4. For directory location you can choose a non-SSL, SSL secure directory, or both. Enter header text to display information on the title bar at visitor login.

    5. Click OK then click Add New User to create a user for the directory.

    6. Enter the New user name and a new password consisting of 6-8 alpha-numeric characters which should not contain the user name. Confirm the password then click OK

    7. A new FTP account is created with user specific login information.

To create FTP user through SSH you would need to follow below mentioned steps:

  1. Login as root through SSH.

  2. Next add the user account you want using the ‘useradd’ command

      useradd <username>
    
  3. Now create a special group for that user.

    groupadd <groupname>

  4. Now to add the user to the group

    gpasswd -a <username> <groupname>

      These commands are non-standard but available on most popular distributions.
      If not, then you can try editing /etc/group using your favorite text editor.
    
  5. Change the group ownership of the special directory to that group.

    chgrp -R groupname /path/to/your/web/directory

  6. Enable write permissions

    chmod -R g+rw /path/to/your/web/directory

Hi, in your commands I see a username and group name being assigned. However, where in those commands do you assign the ftp user’s password?

I notice no one responded to the password question, but usually the password is added using the passwd command

like:

passwd <ftp-user>
where <ftp-user> is the new username