Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Just wanted a quick summary of the differences between them and why there are two? Cheers

share|improve this question
Gotta love those sequential-numbered files where the numbers bear no relation to their function, version or description. – Mark Henderson May 16 '11 at 0:04
@Mark Henderson: yes, what are other examples? – smci Nov 26 '12 at 22:19
Troll and Troll 2 – billynoah May 29 '15 at 16:35
up vote 97 down vote accepted

In OpenSSH prior to version 3, the sshd man page used to say:

The $HOME/.ssh/authorized_keys file lists the RSA keys that are permitted for RSA authentication in SSH protocols 1.3 and 1.5 Similarly, the $HOME/.ssh/authorized_keys2 file lists the DSA and RSA keys that are permitted for public key authentication (PubkeyAuthentication) in SSH protocol 2.0.

The release announcement for version 3 states that authorized_keys2 is deprecated and all keys should be put in the authorized_keys file.

share|improve this answer

The use of authorized_keys2 for protocol 2 has been deprecated since 2001.


share|improve this answer
If only someone would tell redhat that... authorized_keys fails, authorized_keys2 works fine. – El Yobo Sep 20 '11 at 2:33
redhat stuff was last built in 2001 ;-) – ringø Aug 24 '12 at 2:13
So .. what IS the answer here - I am on CentOS 6.2? – javadba Jul 7 '14 at 15:21
@javadba: CentOS is in the same boat as Red Hat. – Dennis Williamson Jul 7 '14 at 15:36
@DennisWilliamson Right.. so is RH (/CentOS) requiring authorized_keys2 or not? My test just now indicates authorized_keys is sufficient.. but would be nice for more insight – javadba Jul 7 '14 at 16:02

Originally the difference was for version differentiation.

But don't bother any more, as now the 2 can be ignored.

share|improve this answer

One really good reason to use authorized_keys2 is if you have a VPS with Arvixe where the tech support team continually overwrites your authorized_keys file.

share|improve this answer

protected by Khaled Jun 11 '12 at 8:24

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.