Is user@host at the end of each key in authorized_keys necessary?

I have a set of 8 small servers that chat with each other over ssh logging in automatically.

Now I would like to have the .ssh directory of all the servers be identical.

Now my question is whether the user@host part at the end of each key really is necessary?


Solution 1:

No, it's entirely optional. This part of the field is a comment, so it's just an information, usually about where the key originally came from.

It's described here (the best reference I could find):

AuthorizedKeysFile specifies the files containing public keys for public key authentication; if none is specified, the default is ~/.ssh/authorized_keys and ~/.ssh/authorized_keys2 Each line of the file contains one key (empty lines and lines starting with a `#' are ignored as comments). Protocol 1 public keys consist of the following space-separated fields: options, bits, exponent, modulus, comment. Protocol 2 public key consist of: options, keytype, base64-encoded key, comment. The options field is optional; its presence is determined by whether the line starts with a number or not (the options field never starts with a number). The bits, exponent, modulus, and comment fields give the RSA key for protocol version 1; the comment field is not used for anything (but may be convenient for the user to identify the key).