SSH Cant Connect : Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password

If you have installed keypair and the remote machine still asking for the password, you can follow the below steps.

You may see the following errors:

debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Next authentication method: gssapi-keyex
debug1: No valid Key exchange context
debug1: Next authentication method: gssapi-with-mic

The reason behind the issue is the user's home directory is encrypted and the connecting machine can't access the keys. So you need to change the location of the key to somewhere else.

mkdir /etc/ssh/theg

cp ~/.ssh/authorized_keys /etc/ssh/theg/

Edit /etc/ssh/sshd_config

RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile      /etc/ssh/theg/authorized_keys

Restart the ssh service:

service sshd restart

Try logging now. Enjoy !!! 🙂

ps : use the verbose option in ssh to get more details : ssh -C root@IP -v

Advertisements

3 thoughts on “SSH Cant Connect : Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password

    • @Tyagi
      Why ? Its possible to change the key location. Its working fine for me… Please elab0rate the issue or error you are getting so I can try to help you.

      Thanks,

      ps : Make sure you update the keypair for all the machines for those the connection was already established !

  1. Pingback: SSH Keygen no CentOS |

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s