How to set up SSH keys for Plesk server?
Connect to the server via SSH;
Create the RSA Key Pair:
# ssh-keygen -t rsa -b 2048
Use default location
/root/.ssh/id_rsaand setup passphrase if required.
The public key is now located in
The private key (identification) is now located in
Note: Permissions for the private key should be
Copy the public key to another server using the
# ssh-copy-id firstname.lastname@example.org
IP addressshould be replaced with second server's credentials.
Alternatively, copy the content of
/root/.ssh/authorized_keyson the second server.
Note: permissions for the
authorized_keysfiles should be set to
Since Plesk 12.0, SSH Keys Manager can be used to upload public part of SSH key pair to a Plesk server.
After successful login using the SSH key, it is possible to restrict the password-based login:
1. Open SSH server configuration file:
# vi /etc/ssh/sshd_config
2. Find the line that includes
and set it to:
CONFIG_TEXT: PermitRootLogin without-password
3. Apply the changes:
# service sshd reload