Protocol major versions differ: 2 vs. 1

Protocol major versions differ: 2 vs. 1

Ever encountered the following weird error message when trying to ssh into any machine.

Protocol major versions differ: 2 vs. 1

The problem here is the allowed protocol for SSH into the remote machine.

The /etc/ssh/sshd_config file normally has the Protocol defined to be used for the SSH service on the machine.

This option is controlled by the parameter Protocol in the /etc/ssh/sshd_config file.

Normally the SSH is configured to run on Protocol 2, which has better security over 1.

The old Linux systems did allowed both the Protocols.

The following is how the old Linux systems had the Protocol parameter defined in the /etc/ssh/sshd_config file:

Protocol 2,1

The modern day Linux systems allow only Protocol 2 in the /etc/ssh/sshd_config file.

Protocol 2

Protocol major versions differ: 2 vs. 1 – Solution

The ssh command itself provides you with the option of using the desired protocol while trying to ssh to a remote server.

So in case you want to ssh to a server running SSH Protocol 1, you will have to use the following command:

[[email protected] ~]# ssh -1 [email protected]

And if you want to ssh to a server running SSH Protocol 2, you will have to use the following command:

[[email protected] ~]# ssh -2 [email protected]

Protocol major versions differ: 2 vs. 1

2 Comments

  • senan

    June 11, 2015 at 6:22 am Reply

    Thank you for the help

  • rezwits

    February 25, 2016 at 8:18 am Reply

    Man you are awesome!!!

Post a Comment

Time limit is exhausted. Please reload CAPTCHA.