I want to control who can log in via SSH on my server. Is it safe to add the group 'ssh' to the users who are allowed to login in?
I see some distros use system groups in the user's ID and others recommend creating new groups. For example, some users will have the sudo group and other distros recommend creating a new group gSudo and adding it to the sudoers file.
1 Answer
The purpose of ssh group was described on Unix. There is no gain by adding user to ssh group, because the group is used only for pre-authentication process.
If you want to use a group to limit who can log in to your server using ssh, create a group sshuser, add AllowGroups sshuser to your /etc/ssh/sshd_config and restart your ssh service.