I am a newbie to linux administration.
I have a box with centos 6.5 x64.
Ive been configuring ssh access via public/private key.
Ive been wondering if I could add the public key to a user group instead of a user (in the /home/username directory).
All users who can ssh will be under a specific group, which will have the public key.
If not, how should I proceed for new users created to have the public key automatically?
Thanks
sshd
normally reads authorized public keys from a file named.ssh/authorized_keys
in each user's home directory. Each user would normally have their own copy of this file and would normally maintain it themselves.The name of this authorized_keys file can be specified in the
sshd_config
file through the AuthorizedKeysFile directive. The default value of this directive is:You can use Match group to add another file to this list:
Match sections like this should go at the end of
sshd_config
. The match rule applies to all directives following the match until the nextmatch
or until the end of the file.You could add this to the
/etc/skel
directory which is used as a template for newly created users.If you want this for only a specific set of users, create an additional
skel
dir and use this during user creation.