Not able to ssh to the server

14,002

Solution 1

Looks like the server and client don’t find a common authentication method.

I just got that with a sun cluster here: It only supports diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1, but my Gentoo GNU/Linux ssh server seems to have dropped the group1 algo.

Fixed by changing /etc/ssh/sshd_config on the ssh server to include

KexAlgorithms [email protected],diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group-exchange-sha256,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521

I fear, though, that there was a reason for removing the group1 algorithm from the default. I would not do this on a publicly accessible box.

For reference also see https://security.stackexchange.com/questions/25662/openssh-default-preferred-ciphers-hash-etc-for-ssh2

Solution 2

Turn on verbose ssh which will hopefully show where the issue is.

E.g.

ssh -v host

If that doesn't give enough info, you can try

ssh -vv host

or even

ssh -vvv host

Look for the first error in the output which will hopefully give you clues as to where the issue lies.

Share:
14,002
Amit Kumar
Author by

Amit Kumar

Working in R&D, Mainly Shell scripting, Linux and Virtualization domain.

Updated on June 04, 2022

Comments

  • Amit Kumar
    Amit Kumar almost 2 years

    not able to login into server through ssh. so logged in with rsh and when trying to ssh host itself getting error :

    no common kex alg: client 'diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1', server 'gss-group1-sha1-toWM5Slw5Ew8Mqkay+al2g=='
    

    I found this log in /var/svc/log/network-ssh:default.log

    [ May 14 21:23:13 Rereading configuration. ]
    
    [ May 14 21:23:13 Executing refresh method ("/lib/svc/method/sshd restart") ]
    
    [ May 14 21:23:13 Method "refresh" exited with status 0 ]
    
    [ May 14 21:30:25 Stopping because service disabled. ]
    
    [ May 14 21:30:25 Executing stop method (:kill) ]
    
    [ May 14 21:33:08 Enabled. ]
    
    [ May 14 21:33:08 Executing start method ("/lib/svc/method/sshd start") ]
    
    Could not load host key: /.ssh/id_dsa
    
    Could not load host key: /.ssh/identity
    
    Disabling protocol version 1. Could not load host key
    
    [ May 14 21:33:08 Method "start" exited with status 0 ]
    

    thanks in advance.