Note: This article applies to older SSH versions (SSH version 1). For the latest information on SSH key logins, see OpenSSH Public Key Authentication under Ubuntu .
SSH Config for SSH Key customize
On the remote server, the
/ Etc / ssh / sshd_config
to be edited. Change the following values:
#AuthorizedKeysFile% h / .ssh / authorized_keys
AuthorizedKeysFile% h / .ssh / authorized_keys
#IgnoreUserKnowHosts yes ChallengeResponseAuthentication yes PasswordAuthentification yes
IgnoreUserKnowHosts yes ChallengeResponseAuthentication no PasswordAuthentification no
Then, restart the SSH service:
Generate a key pair on Linux
The key pair is now created. Next, you will be prompted for the name of the key and the location.
IMPORTANT: Protect your private key with a password.
You will find it in the home directory of your user
the key pair.
The public key is located in the file
The contents of this file are now stored on the remote server at:
If everything worked out, you should be able to log on to the remote server using the following command:
ssh $ SERVERIP_ODER_HOSTNAME_DES_ENTFERNTEN_SERVERS -i /home/$USERNAME/.ssh/id_dsa
Root direct login (optional)
Please be careful, otherwise you can lock yourself out. If you forbid the direct root login, there must be another user on the system
SSH is the default tool for Linux administrators. To protect the server better, you should ban the direct root login. You can still log on to the server with another user and then use per
to the root user.
To do this, we edit / etc / ssh / sshd_config and set