Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: How to provide SFTP access to FTP normal users  (Read 6583 times)

0 Members and 1 Guest are viewing this topic.

rohitj

  • Guest
How to provide SFTP access to FTP normal users
« on: December 28, 2013, 07:07:47 pm »
How to provide SFTP access to FTP normal users

It is possible to provide SFTP access to domain users in Plesk from Plesk control panel itself. But it is not possible to provide SFTP access for normal FTP users.

In order to provide SFTP access for domain user just follow the steps below.

1) Login to Plesk
2) Click the "Websites & Domains" tab.
3) Click "FTP Access".
4) Click the FTP account to which you want to grant SFTP access.
5) Change the "Access to the server over SSH" drop-down menu to any value other than "Forbidden". The most secure choice is "/bin/bash (chrooted)" which will allow SFTP and very little else.



In the case of normal users, there won't have such option.



You won;t be able to access your server via SFTP using that user.

Code: [Select]
w8:~$ sftp normalusr@domainname.com
Connecting to domainname.com...
normalusr@domainname.com's password:
Connection closed

In order to provide this access, check the shell of the domain user to which you have just provided shell access.

Code: [Select]
root:~#  cat /etc/passwd | grep mhtest*
mhtest:x:10011:115::/var/www/vhosts/mhtest.com:/opt/psa/bin/chrootsh

We could see that it is '/opt/psa/bin/chrootsh' . Assign this shell to your other user.

Code: [Select]
root:~#chsh normalusr
Changing the login shell for normalusr
Enter the new value, or press ENTER for the default
        Login Shell [/bin/false]: /opt/psa/bin/chrootsh

Now try to access your server vuia SFTP using this user.

Code: [Select]
w8:~$ sftp normalusr@domainname.com
Connecting to domainname.com...
normalusr@domainname.com's password:
sftp> pwd
Remote working directory: /


Enjoy.......  ;)