Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
239 views
in Technique[技术] by (71.8m points)

ubuntu - ssh change default authentication

when I try to access to a router with ssh enabled, it says this:

Unable to negotiate with 101.16.16.2 port 22: no matching key exchange method found. Their offer: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1

To resolve this problem, I can execute the following command to force ssh to use the authentication method that the router uses

ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 -c aes128-cbc -l <username> 10.10.10.5

Is there any way to configure ssh to use that authentication by default. Thanks

question from:https://stackoverflow.com/questions/66062463/ssh-change-default-authentication

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You can edit the ~/.ssh/config and add the information of the host IP and ciphers. In your case, it should state:

Host 101.16.16.2
    KexAlgorithms +diffie-hellman-group1-sha1
    Ciphers aes128-cbc

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...