Plesk Parallels add authorized keys authentication

In Parallels Plesk 9.x, 10.x and 11.x for Linux (in this case CentOS 6.6) there is a bug. You can not authenticate via ssh key or add one f.e. with:

$> ssh-copy-id -i .ssh/deploy_rsa.pub user@ask-sheldon.com

Thats why you have to do this:

  1. Edit ssh deamon configuration:
    $> sudo nano /etc/ssh/sshd_config
  2. Add the following line:
    AuthorizedKeysFile %h/private/.ssh/authorized_keys
  3. Restart the SSH Deamon:
    $> sudo service sshd restart
  4. Now the user can add a .ssh folder to his private folder that is read-, write- and executable by himself and his group:
    $> cd private
    $> mkdir .ssh
    $> chmod og-xrw .ssh
  5. Now the user can put his public key into the private/.ssh/authorized_keys file like this (from local machine):
    $> scp .ssh/deploy_rsa.pub user@ask-sheldon.com:private/.ssh/deploy_rsa.pub

    and on the machine:

    $> cd private/.ssh
    $> cat deploy_rsa.pub >> authorized_keys
  6. Now he should be able to connect without password prompt. F.e.:
    $> ssh -i .ssh/deploy_rsa user@ask-sheldon.com

Leave a Reply

Your email address will not be published.

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.