I know one way, running on a list of server like so:
for server in $(cat server.list); do ssh-copy-id user@host done
But I was wondering if there's a better way to do it? something automatic which will not require any user input. Can NIS do that?
Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.Sign up to join this community
If your shop uses a configuration management tool such as Puppet, CFEngine, Chef, etc, that would be the easiest way.
If not, but you have an directory service that does LDAP, there is an extension to OpenSSH to store public keys in the directory.
Lastly, you can wrap the public keys into an RPM and distribute them like you would software. This would also help with lifecycle management, such as replacing, adding, removing keys are essentially solved problems.