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:
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?