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

Added group creation option and corresponding documentation #76

Merged
merged 2 commits into from
May 31, 2023

Conversation

courtarro
Copy link
Contributor

Added a new config option SSH_GROUPS, which is a list of groups and GIDs to create. These groups will be created before the users are created (assuming SSH_USERS is also specified). Specifying this option disables automatic group creation of user-named groups if you also specify SSH_USERS since it's assumed you want greater control in this case.

My use case is such that my users are all members of one group, so this lets me create the group first, then create the users and set their GIDs to the group I just created.

# Add groups if SSH_GROUPS=group:gid set
if [ -n "${SSH_GROUPS}" ]; then
USERS=$(echo $SSH_USERS | tr "," "\n")
GROUPZ=$(echo $SSH_GROUPS | tr "," "\n")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It took me quite a long time to discover that the natural name for this variable, GROUPS, is a reserved keyword in bash, and assigning to it silently kills the script!

entry.sh Outdated Show resolved Hide resolved
Copy link
Member

@macropin macropin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this. Just that one line that needs removal.

@macropin macropin merged commit 37967ed into panubo:main May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants