I've used this article: http://developer.apple.com/library/mac/#documentation/MacOSXServer/Conceptual/XServer_ProgrammingGuide/Articles/SSH.html in order to help set up ssh certificates (I'm on mac os x).
I see that the keys are put in a file called authorized_keys2
.
Does it matter what this file is called? Also, on non-personal servers (servers where others may have root access) is it safe to use the same authorized_keys2
file? Would they be able to use that to access my personal servers somehow? Or do I use separate authorization files for different servers/ groups of servers?
Are there any other good "general practices" as far as having several servers with key based auth that are not mentioned in this article?
authorized_keys2 or more commonly authorized_keys are the default filenames. At least with OpenSSH server you are able to rename the file as you like with the AuthorizedKeysFile directive:
The distinction from authorized_keys versus authorized_keys2 comes about during the transition from SSH v1 to SSH v2. Now SSH v2 is the "default standard" so the name has converged back to authorized_keys in most cases.
The "key" (pardon the pun) point to understand is the private key remains private and is stored on the client machine only. The public key may be published to one or many servers as access needs dictate. In that way, ability to see/view/copy the public key only grants additional access to the private key but importantly may not be used by itself to gain access.
EDIT:
My favorite series of articles regarding SSH key based authentication were published by IBM several years ago.
Keep in mind these articles are 10 years old now and some things have changed. Still, they remain the most comprehensive explanation for all the nuances involved I have found to date.