• Dear Pleskians! The Plesk Forum will be undergoing scheduled maintenance on Monday, 7th of July, at 9:00 AM UTC. The expected maintenance window is 2 hours.
    Thank you in advance for your patience and understanding on the matter.

login using ssh on multiple user accounts

Azurel

Silver Pleskian
Hi,

What I want: A customer can only use SSH+Keyfile to upload/download to his domain with WinSCP. FTP is deactivated!

For this.. I have set in /etc/ssh/sshd_config:
Code:
AuthorizedKeysFile 	/etc/keys/%u_AuthorizedKeys
and in shell
service sshd restart

created /etc/keys with chmod 700

created three files with content from puttygen:

"root_AuthorizedKeys" with chmod 600 and chown -R root:root /etc/keys/root_AuthorizedKeys
"customerA_AuthorizedKeys" with chmod 600 and chown -R customerA:psacln /etc/keys/customerA_AuthorizedKeys
"customerB_AuthorizedKeys" with chmod 600 and chown -R customerA:psacln /etc/keys/customerB_AuthorizedKeys

customerA is the username in Plesk and owner of /var/www/vhosts/domainA/httpdocs
customerB is the username in Plesk and owner of /var/www/vhosts/domainB/httpdocs

root login with keyfile working fine, but customerA und customerB says "Server refused key".


Another way...


in /etc/ssh/sshd_config remove this line:
Code:
AuthorizedKeysFile 	/etc/keys/%u_AuthorizedKeys
and in shell
service sshd restart

root/.ssh/authorized_keys

/home/customerA/.ssh/authorized_keys
/home/customerB/.ssh/authorized_keys

chown -R customerA:psacln /home/customerA
chown -R customerB:psacln /home/customerB

Here again .. root working.. customer get "Server refused key".


Whats wrong? Can anybody help me here?


EDIT: I found in "Web Hosting Access" for "customerA" the option "Access to the server over SSH" and set it to "/bin/bash". But thats not help.


SOLUTION:
use /var/www/vhosts/domainA/.ssh/authorized_keys
 
Last edited:
Back
Top