Summary
This doc outlines common causes of SSH authentication failing.
Problem Description
One of the most common causes of SSH authorization failing is not being able to access the private key used in authentication.
Troubleshooting Steps
Make sure the path to the private key is correct in the SSH command:
1. Locate the path to the private key used in authentication. This is usually generated during server setup although additional keys can be generated with access to the server.
2. The path is specified using the -i parameter after the ssh command.
Example: ssh -i "/fakepath/sshkey.pem" username@serverurl.com
Make sure the private key has the correct permissions:
Example problem when attempting to SSH, the following error is observed.
ssh -i "/fakepath/sshkey.pem" username@serverurl.com
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0777 for '/fakepath/sshkey.pem' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
Load key '/fakepath/sshkey.pem': bad permissions
username@serverurl.com: Permission denied (publickey).
Change the read/write access to the private key to 400 using the chmod command.
Example: "chmod 400 /fakepath/sshkey.pem"
Outcome
If you're using the right key with the right permissions, you should be able to authenticate to the SSH server.
Comments
0 comments
Please sign in to leave a comment.