To resolve this issue, edit the ssh configuration file, disable public key authentication, and enable password login, as follows:. This quick guide showed you how to address various issues that may cause the permission denied publickey error in SSH.
If this issue persists, consider other troubleshooting methods. My name is John and am a fellow geek like you.
I am passionate about all things computers from Hardware, Operating systems to Programming. My dream is to share my knowledge with the world and help out fellow geeks.
The error suggests that the public key is the issue, which is misleading. This file contains the list of public keys for the clients allowed to SSH into the server. Both solutions contain steps you need to perform on the server-side. Start by opening the terminal on your server and proceed with one of the solutions below. In the file, find the PasswordAuthentication line and make sure it ends with yes.
Find the ChallengeResponseAuthentication option and disable it by adding no. If lines are commented out, remove the hash sign to uncomment them. Using the password-based login as the SSH authentication method is not recommended due to security concerns.
Therefore, the following solution may be preferable since it troubleshoots the public key authentication method. Note: The steps above are considered best security practices. If you need to use root login, set the relevant line to yes. Finally, enter a passphrase to secure the key. Press Enter and confirm the passphrase once more when requested.
The password is required any time you use the key for authentication. Lastly, the program prints out information about where the keys are stored. Additionally, a digital and a graphic representation print to the console too. Use the Windows search box to find cmd and open the Command Prompt window. Note: Command not working? Don't worry.
There are other ways to generate the keys. Try following our detailed tutorial for generating an SSH key pair on Windows If you set up a specific location for the keys, type in the path now. Otherwise, press Enter to save the keys in the default path. If keys exist in this location, the output asks to confirm the overwrite. Type Y to confirm and press Enter to continue the setup. Enter the passphrase to encrypt the private key.
Re-enter the same passphrase and press Enter to finish generating the key pair. For multiple users and keys, copy each new key onto a new line. Save the file and close. The output shows the number of keys automatically copied to the server along with further instructions. After generating and copying the keys, log into your server from the local machine using the following command:.
Public key authentication is a safer and recommended way to connect with SSH instead of a regular password login.
0コメント