Permission denied (publickey)
Description of the error
If you are getting the error Permission denied (publickey) when you attempt to login to a CSE server then there is likely a problem with how your ssh keys are installed. There can be a number of things wrong that will cause this error.
Is your private key installed and being loaded properly?
Make sure that you are using the same private key that was generated with the public key we have on file. Your private key is usually named id_rsa, id_dsa, or identity whereas your public key usually ends with .pub.
Did you enter the correct ssh passphrase?
Make sure that you can load your ssh private key using a tool like ssh-add.
sbeards@shell $ ssh-add -D # to delete any keys first
All identities removed.
sbeards@shell $ ssh-add
Enter passphrase for /home/sbeards/.ssh/id_rsa:
Identity added: /home/sbeards/.ssh/id_rsa (/home/sbeards/.ssh/id_rsa)
sbeards@shell $ ssh-add -l
2048 e6:d3:b0:81:3d:17:26:31:4a:ef:47:81:53:e4:50:17 /home/sbeards/.ssh/id_rsa (RSA)
Is your public key installed on the server?
Did you send the public key, that is matched with your private key, to CSE IT admins? Did we install it? If not, you will not have access.
Are you using the correct username to access the server?
Make sure that the username you are using matches the one that we have installed on the server.
Did you change any permissions on the server recently?
The permissions of your home directory, the .ssh directory in your home directory, and the authorized_keys file in your .ssh directory are very important. Take care not to allow other users to read or write to your home directory. Also, make sure that your .ssh directory has 700 (rwx only by you) permissions. The authorized_keys file should have 600 (rw by only you) permissions.
Getting help
If you still cannot login to your account then contact IT Help and ask us to check things out on the server. Be sure to send us the verbose output of your login attempt (use something like ssh -vvv <servername>).
see also:
-
Use SSH at CSE
- This document describes how we use SSH at CSE and gives you pointers on how to access our computational resources