Articles in this section

SFTP is not available for additional FTP users on Plesk server

Plesk for Linux kb: technical ABT: Group A

Applicable to:

  • Plesk for Linux

Symptoms

  • SFTP connection with subscription's additional FTP user cannot be established with the similar error on connection attempt:

    # sftp additional_user@203.0.113.2
    additional_user@203.0.113.2's password: 
    Connection closed

    # sftp additional_user@203.0.113.2
    additional_user@203.0.113.2's password: 
    unexpected end of file

    Note: SFTP stands for SSH File Transfer Protocol and uses SSH for establishing a connection and transferring the data.
    FTP and FTPS connections are not affected by this issue, as they use different protocols and mechanisms.

  • Similar errors might be logged by the Journal:

    # journalctl --since="10m ago" | grep chrootsh
    plesk-chrootsh[16727]: user with id=10000 and name=additional_user not found in chrooted passwd file 
    plesk-chrootsh[16727]: system error: No such file or directory

Cause

SFTP configuration for additional FTP users is not implemented in Plesk yet.

Resolution

If you believe that having multiple SFTP users under one subscription is a must-have, please vote for this feature request on our Product Roadmap page:

 

As a workaround, apply the following steps

Warning: Such configuration was not officially tested. It might be changed automatically in case users are modified through Plesk.
Shell value of the additional user will not be synchronized with the main user.

  1. Connect to the server via SSH.
  2. Download and unpack the script:

    # curl -LO https://github.com/plesk/kb-scripts/raw/master/clone-shell/clone-shell.sh
    # chmod +x clone-shell.sh

  3. Verify the Forbidden is not set for main system user in Domains > example.com > Hosting & DNS > Hosting > SSH Access > Type

  4. Run the script providing the names of additional users:

    # ./clone-shell.sh examplecom1 examplecom2
    Changing examplecom1 shell from /bin/false to /usr/local/psa/bin/chrootsh 
    Adding examplecom1 to the chrooted passwd file 
    Changing examplecom2 shell from /bin/false to /usr/local/psa/bin/chrootsh 
    Adding examplecom2 to the chrooted passwd file

    Note: The additional user should have access to the / directory in Plesk under Domains > FTP Access > additional_user

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.