Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for AllowGroups instead of AllowUsers in the SSH daemon? #165

Open
vivvvi opened this issue Jun 15, 2022 · 2 comments
Open

Support for AllowGroups instead of AllowUsers in the SSH daemon? #165

vivvvi opened this issue Jun 15, 2022 · 2 comments

Comments

@vivvvi
Copy link

vivvvi commented Jun 15, 2022

change request:

    /etc/ssh/sshd_config:  Use AllowGroups instead of AllowUsers in sshd_config.

slickstack by default uses AllowUsers whereas in a multi user / groups linux environment AllowGroups is essential, and in my opinion more desirable for everyone.

my configuration:

In our environment we have a group called ssh-users and users that are allowed to login added to the group.

so.. in /etc/ssh/sshd_config

the line for AllowUsers I replace with

AllowGroups ssh-users

@jessuppi jessuppi changed the title sshd_config Support for AllowGroups instead of AllowUsers in the SSH daemon? Jun 16, 2022
@jessuppi
Copy link
Member

Thanks for sharing @vivvvi

One thing I hadn't considered when you mentioned this on Discord is IP restrictions. To simplify IP restrictions, we use the SSH daemon for this (instead of e.g. hosts file or UFW firewall rules):

AllowUsers @SUDO_USER@SSH_IPV4 @SFTP_USER

If we wanted to support IP restrictions per sudo group, I think we need to use a Match block:

Ref: https://unix.stackexchange.com/questions/334566/using-allowgroups-and-restrict-by-ip-address

I don't really like Match blocks as I think it complicates the SSH daemon, esp. since we are already using a chroot block for the SFTP user on SlickStack. Will probably need to consider all of this and see if it's possible.

Subsystem sftp internal-sftp
Match User @SFTP_USER
ChrootDirectory /var/www
ForceCommand internal-sftp
AllowTcpForwarding no
X11Forwarding no

Ref: https://github.com/littlebizzy/slickstack/blob/master/modules/ubuntu/22.04/sshd-config.txt

Anyway, I'm guessing your agency does not even use SFTP access at all, which is why you do that approach? Or, do you use another group for allowing SFTP access only?

@jessuppi
Copy link
Member

By the way, we might also need to revise groups in sudoers also...

By default Ubuntu has @sudo and @admin groups... just mentioning this here to remember later.

Ref: https://github.com/littlebizzy/slickstack/blob/master/modules/ubuntu/sudoers.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants