Articles in this section

How to grant a Subscription or Domain user SSH or SFTP access to its home directory in Plesk?

kb: how-to Plesk for Linux

Applicable to:

  • Plesk for Linux

Question

  • How to grant SSH or SFTP access to the home directory of Subscriptions under a Service Plan?

Answer

Note: The feature to provide SSH access to a particular directory (for example, /var/www/vhosts/example.com/httpdocs/) is not implemented in Plesk yet. If you would like to see this functionality in Plesk, vote for this feature on Plesk UserVoice. The top-ranked suggestions are likely to be included in the next versions of Plesk.

For a Subscription or Domain

Note: Only the system user of a Subscription or Domain can receive SSH access

  1. Log into Plesk

  2. Go to Domains (or Subscriptions) > example.com > Hosting & DNS > Hosting

  3. Select a user shell Type in the SSH Access field

    Note: To learn more about different types of the shells, visit this KB article.



  4. Click OK to apply the changes.

    At this point, in order to connect to the Plesk server as a Subscription user via SSH (or SFTP), you should use the Username of the System user and the selected password.

 

For all Subscriptions under a Service Plan
  1. Log into Plesk

  2. Go to Service Plans > Plan_Name > Hosting Parameters.

  3. Select a user shell in the SSH access to the server shell under the subscription's system user dropdown list.

    Note: To learn more about different types of the shells, visit this this KB article.




  4. Additional step: To propagate the new user shell to existing subscriptions, go to Service Plans > plan_name > Default > Permissions tab and set Management of access to the server over SSH to Not Allowed.




  5. Click Update & Sync to apply the changes and synchronize subscriptions with the service plan.

The same thing can be achieved via commands, as shown in the following section:

Click on a section to expand

For all Subscriptions under a Service Plan via CLI commands


You can use the plesk bin service_plan command utility and its -manage_sh_access and -manage_not_chroot_shell options for the purpose, an example is provided below:

1. Log into your server via SSH
2. Afterwards, you can execute one of the following commands (depending on your needs):

To allow the users who subscribe to the Service Plan Plan 1 to access over SSH to the chrooted environment on the server.

# plesk bin service_plan -u "Plan 1" -manage_sh_access true

OR

To allow the users who subscribe to the Service Plan Plan 1 to access over SSH to any shell available on the server:

# plesk bin service_plan -u "Plan 1" -manage_not_chroot_shell true

Was this article helpful?

Comments

2 comments
Date Votes
  • Is it possible to configure SSH access type for a domain via an interface (XML API, REST API, or CLI)?

    0
  • Hi Plesk Team,

    Thanks for the documentation!

    I’d like to suggest a small update to this article. While it states that SSH/SFTP is limited to the main Subscription System User, recent Plesk updates 18.0.80 for Linux introduced native SFTP support for additional FTP accounts (via a separate ProFTPD instance, managed under Tools & Settings > Security Policy > "Allow SFTP for FTP accounts").

    It might be helpful to update this guide or add a note pointing users to that new feature, as many are looking for a way to grant SFTP access to secondary users without giving them full SSH/system user access.

    Keep up the great work!

    0

Please sign in to leave a comment.