How To Configure Ssh Key Authentication In Linux?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
1. Generate an SSH keypair: Run the ssh–keygen command from the terminal window. This command will then prompt you to enter a passphrase. Entering a passphrase is optional, but recommended for security purposes.
2. Copy the public key to the server: After the key is generated, copy the public key to your server. The best way to do this is by using the ssh–copy–id command.
3. Configure the SSH daemon: Edit the /etc/ssh/sshd_config file. Find the line that reads PasswordAuthentication and set it to no.
4. Restart the SSH daemon: Restart the SSH daemon by running the command service ssh restart.
5. Test the setup: Test the setup by logging in to the server using the private key.