I was able to SSH into this remote server using password authentication before. I wanted to change that to make it use private/public key pairs instead. I followed the necessary steps by generating a key pair, editing the /etc/ssh/sshd_config
file to enable RSA and Pubkey authentication, and disable password authentication:
RSAAuthentication yes
PubkeyAuthentication yes
PasswordAuthentication no
The problem is that I (mistakenly) moved the authorized_keys
file out of the ~/.ssh/
folder in the remote host. Therefore, after exiting the remote host I can't SSH back in as it doesn't recognize my private key, giving me the following message:
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
Am I permanently locked out of the remote server now? Is there a way to specify the location of the authorized_keys
file in the SSH command itself?
RSAAuthentication yes
. That only applies to ssh v1, which is long deprecated. If yoursshd_config
includesProtocol 2
rather thanProtocol 2,1
orProtocol 1.2
, you are not allowing ssh v1 anyway.RSAAuthentication
wasn't insshd_config
in the first place.