[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6FCV5KD4EHP57TRRB8XRWBT":3,"skill-same:01M6FCV5KD4EHP57TRRB8XRWBT":79},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":45,"linkOnly":46,"markdownContent":47,"markdownBody":48,"frontMatter":49,"refName":32,"commitSha":59,"skillDirectory":60,"forksCount":61,"repositoryHtmlUrl":62,"repositoryHomepageUrl":6,"ownerHtmlUrl":63,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":64,"install":65,"resources":78},"01M6FCV5KD4EHP57TRRB8XRWBT","user-management",null,"Manage users, groups, and permissions on Linux systems. Configure sudo and access controls. Use when managing system access.","boisenoise\u002Fskills-collections","boisenoise","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F193180?v=4","01M6CDBDQK6BDN55ZMA6B6PKBM","01M6CDBDVSJ3JPTBYN26FZ7TZK",13,"MIT","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-user-management\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],"user management","management","user","manage","2026","when","sudo","relevant","helper","controls","scripts","critical","os","platform","main","community","linux","agent-skills","only","use","system","configure","access","devops-security","license","permissions","security","2026-11-10 10:12:30",false,"---\nname: user-management\ndescription: Manage users, groups, and permissions on Linux systems. Configure sudo\n  and access controls. Use when managing system access.\ncategory: devops\nrisk: critical\nsource: https:\u002F\u002Fgithub.com\u002FBagelHole\u002FDevOps-Security-Agent-Skills\nsource_repo: BagelHole\u002FDevOps-Security-Agent-Skills\nsource_type: community\ndate_added: '2026-09-20'\nlicense: MIT\nlicense_source: https:\u002F\u002Fgithub.com\u002FBagelHole\u002FDevOps-Security-Agent-Skills\u002Fblob\u002Fmain\u002FLICENSE\ncompatibility: Requires the relevant OS\u002Fplatform tooling and privileged access where\n  noted. Docs-only; helper scripts and templates not bundled.\nmetadata:\n  author: devops-skills\n  version: '1.0'\n---\n\n# User Management\n\nManage users, groups, permissions, sudo access, PAM modules, and LDAP integration on Linux systems. Includes practical scripts for bulk user operations and access auditing.\n\n## When to Use\n\n- Creating and managing local user accounts on Linux servers\n- Configuring sudo access with fine-grained privilege controls\n- Setting up group-based access control for teams\n- Integrating Linux hosts with LDAP or Active Directory for centralized auth\n- Auditing user accounts, permissions, and access patterns\n- Automating bulk user provisioning and deprovisioning\n\n## Prerequisites\n\n- Root or sudo access on the target system\n- `shadow-utils` package (provides useradd, usermod, etc.) -- installed by default\n- `libpam-modules` for PAM configuration\n- For LDAP: `sssd`, `realmd`, `libpam-ldapd`, or `nslcd` packages\n- For auditing: `auditd` package\n\n## User Operations\n\n### Creating Users\n\n```bash\n# Create a user with home directory, default shell, and comment\nuseradd -m -s \u002Fbin\u002Fbash -c \"Jane Smith\" jsmith\n\n# Set the user's password interactively\npasswd jsmith\n\n# Create a user with a specific UID and primary group\nuseradd -m -s \u002Fbin\u002Fbash -u 1500 -g developers -c \"Deploy Account\" deploy\n\n# Create a system account (no home, no login shell) for running services\nuseradd -r -s \u002Fusr\u002Fsbin\u002Fnologin -d \u002Fopt\u002Fmyapp -c \"MyApp Service Account\" myapp\n\n# Create a user with an expiration date (contractor access)\nuseradd -m -s \u002Fbin\u002Fbash -e 2025-12-31 -c \"Contractor - Bob Lee\" blee\n\n# Create user and add to multiple supplementary groups at creation time\nuseradd -m -s \u002Fbin\u002Fbash -G docker,developers,ssh-users -c \"Dev User\" devuser\n```\n\n### Modifying Users\n\n```bash\n# Add a user to a supplementary group (preserving existing groups with -a)\nusermod -aG sudo jsmith\nusermod -aG docker,developers jsmith\n\n# Change the user's login shell\nusermod -s \u002Fbin\u002Fzsh jsmith\n\n# Change the user's home directory and move existing files\nusermod -d \u002Fhome\u002Fjsmith-new -m jsmith\n\n# Lock the password only; SSH keys\u002Fother authentication may still work.\n# Full deprovisioning requires separately reviewing expiry, sessions and keys.\nusermod -L jsmith\n\n# Unlock a user account\nusermod -U jsmith\n\n# Set an account expiration date\nusermod -e 2025-06-30 blee\n\n# Change a user's login name\nusermod -l jsmith-new jsmith\n\n# Force password change on next login\nchage -d 0 jsmith\n\n# Set password aging: min 7 days, max 90 days, warn 14 days before\nchage -m 7 -M 90 -W 14 jsmith\n\n# View password aging info\nchage -l jsmith\n```\n\n### Deleting Users\n\n```bash\n# Remove a user and their home directory\nuserdel -r jsmith\n\n# Remove a user but keep their home directory (for auditing)\nuserdel jsmith\n\n# Find and reassign files owned by a deleted user (by UID)\nfind \u002F -uid 1500 -exec chown newowner:newgroup {} \\;\n```\n\n## Group Management\n\n```bash\n# Create a new group\ngroupadd developers\n\n# Create a group with a specific GID\ngroupadd -g 2000 devops\n\n# Add a user to a group\nusermod -aG developers jsmith\n# Alternative using gpasswd\ngpasswd -a jsmith developers\n\n# Remove a user from a group\ngpasswd -d jsmith developers\n\n# Set group administrators (can add\u002Fremove members without root)\ngpasswd -A jsmith developers\n\n# Delete a group\ngroupdel developers\n\n# List all groups a user belongs to\ngroups jsmith\nid jsmith\n\n# List all members of a group\ngetent group developers\n\n# Show all groups on the system\ncat \u002Fetc\u002Fgroup | cut -d: -f1 | sort\n```\n\n## Sudo Configuration\n\n```bash\n# Always edit sudoers via visudo (syntax validation prevents lockout)\nvisudo\n\n# Better: use drop-in files in \u002Fetc\u002Fsudoers.d\u002F\nvisudo -f \u002Fetc\u002Fsudoers.d\u002Fdevelopers\n```\n\n### \u002Fetc\u002Fsudoers.d\u002Fdevelopers\n\n```text\n# Allow the developers group to restart specific services\n%developers ALL=(ALL) NOPASSWD: \u002Fusr\u002Fbin\u002Fsystemctl restart myapp, \u002Fusr\u002Fbin\u002Fsystemctl status myapp\n\n# Allow a deploy user full sudo with no password\ndeploy ALL=(ALL) NOPASSWD: ALL\n\n# Allow ops team to run docker commands only\n%ops ALL=(ALL) NOPASSWD: \u002Fusr\u002Fbin\u002Fdocker, \u002Fusr\u002Fbin\u002Fdocker-compose\n\n# Allow a user to run commands as a specific service account\njsmith ALL=(myapp) NOPASSWD: \u002Fopt\u002Fmyapp\u002Fbin\u002F*\n\n# Restrict to specific hosts (useful with centralized sudoers)\njsmith dbservers=(root) \u002Fusr\u002Fbin\u002Fsystemctl restart postgresql\n\n# Log all sudo commands to a dedicated file\nDefaults log_output\nDefaults!\u002Fusr\u002Fbin\u002Fsudoreplay !log_output\nDefaults logfile=\"\u002Fvar\u002Flog\u002Fsudo.log\"\n\n# Require password re-entry every 5 minutes (default is 15)\nDefaults timestamp_timeout=5\n\n# !authenticate DISABLES password authentication; do not use it to require passwords.\n# Remove conflicting NOPASSWD grants and review explicit PASSWD command tags\n# with visudo; verify effective behavior using sudo -l and a separate test session.\n```\n\n```bash\n# Validate sudoers syntax without applying\nvisudo -c\n\n# Check what sudo permissions a user has\nsudo -l -U jsmith\n\n# Test a specific sudo command as a user\nsudo -u myapp \u002Fopt\u002Fmyapp\u002Fbin\u002Fhealthcheck.sh\n```\n\n## File Permissions and ACLs\n\n```bash\n# Standard permissions\nchmod 755 \u002Fopt\u002Fmyapp           # rwxr-xr-x\nchmod 640 \u002Fetc\u002Fmyapp.conf      # rw-r-----\nchmod u+x script.sh            # Add execute for owner\nchmod g+w shared-dir\u002F          # Add write for group\nchmod o-rwx private-file       # Remove all permissions for others\n\n# Change ownership\nchown deploy:developers \u002Fopt\u002Fmyapp\nchown -R deploy:developers \u002Fopt\u002Fmyapp\u002F   # Recursive\n\n# Set the SGID bit (new files inherit group ownership)\nchmod g+s \u002Fopt\u002Fshared\u002F\n\n# Set the sticky bit (only owner can delete their files)\nchmod +t \u002Ftmp\u002Fshared\u002F\n\n# Access Control Lists (ACLs) for fine-grained control\n# Grant read-execute to a specific user on a directory\nsetfacl -m u:jsmith:rx \u002Fopt\u002Fmyapp\u002Flogs\u002F\n\n# Grant read-write to a group\nsetfacl -m g:developers:rw \u002Fopt\u002Fshared\u002F\n\n# Set default ACL (applied to new files created in the directory)\nsetfacl -d -m g:developers:rw \u002Fopt\u002Fshared\u002F\n\n# View ACLs\ngetfacl \u002Fopt\u002Fshared\u002F\n\n# Remove a specific ACL entry\nsetfacl -x u:jsmith \u002Fopt\u002Fmyapp\u002Flogs\u002F\n\n# Remove all ACLs\nsetfacl -b \u002Fopt\u002Fshared\u002F\n```\n\n## PAM Configuration\n\nThe settings below are fragments for the named configuration files, not shell commands or a complete PAM stack. Use distro-supported profile tooling, preserve recovery access and validate authentication in a separate session. Do not append faillock lines without the required ordering\u002Fcontrol flow.\n\n```text\n# PAM config files are in \u002Fetc\u002Fpam.d\u002F\n# Each file controls auth for a specific service (sshd, login, sudo, etc.)\n\n# Enforce password complexity via pam_pwquality\n# \u002Fetc\u002Fpam.d\u002Fcommon-password (Debian) or \u002Fetc\u002Fpam.d\u002Fsystem-auth (RHEL)\npassword requisite pam_pwquality.so retry=3 minlen=12 dcredit=-1 ucredit=-1 ocredit=-1 lcredit=-1\n\n# Configure \u002Fetc\u002Fsecurity\u002Fpwquality.conf\nminlen = 12\ndcredit = -1\nucredit = -1\nocredit = -1\nlcredit = -1\nmaxrepeat = 3\ndictcheck = 1\n\n# Limit concurrent logins per user\n# \u002Fetc\u002Fsecurity\u002Flimits.conf\njsmith hard maxlogins 3\n@developers hard maxlogins 5\n\n# Lock account after 5 failed login attempts\n# \u002Fetc\u002Fpam.d\u002Fcommon-auth (Debian)\nauth required pam_faillock.so preauth silent deny=5 unlock_time=900\nauth required pam_faillock.so authfail deny=5 unlock_time=900\n\n# View failed login attempts\nfaillock --user jsmith\n\n# Unlock a locked account\nfaillock --user jsmith --reset\n```\n\n## LDAP \u002F Active Directory Integration\n\n```bash\n# Install SSSD and realmd for AD integration (Ubuntu\u002FDebian)\napt install -y sssd realmd adcli sssd-tools libnss-sss libpam-sss\n\n# Install SSSD and realmd (RHEL\u002FCentOS)\ndnf install -y sssd realmd adcli sssd-tools oddjob oddjob-mkhomedir\n\n# Discover and join an Active Directory domain\nrealm discover corp.example.com\nrealm join corp.example.com -U admin@CORP.EXAMPLE.COM\n\n# Verify the join\nrealm list\n\n# Allow specific AD groups to log in\nrealm permit -g \"Linux Admins@corp.example.com\"\nrealm permit -g \"Developers@corp.example.com\"\n\n# Deny all except permitted groups\nrealm deny --all\nrealm permit -g \"Linux Admins@corp.example.com\"\n\n# Restart SSSD after config changes\nsystemctl restart sssd\n\n# Test LDAP user lookup\nid jsmith\ngetent passwd jsmith\n\n# Grant sudo to an AD group\necho '%linux\\ admins ALL=(ALL) ALL' > \u002Fetc\u002Fsudoers.d\u002Fad-admins\n```\n\n## Bulk User Management Scripts\n\n### Bulk User Creation from CSV\n\nIllustrative simple CSV only: reject headers\u002Fempty rows, option-like usernames, unapproved groups and shells before running. Use a proper CSV parser for quoting\u002Fcommas. Add fail-fast handling and stop on any useradd\u002Fchpasswd\u002Fchage failure; never continue as if provisioned. Docker group\u002FCLI access and broad sudo are effectively privileged, not restricted application access. Do not grant these examples without explicit role authorization.\n\n```bash\n#!\u002Fbin\u002Fbash\nset -euo pipefail\n# bulk-create-users.sh\n# CSV format: username,fullname,groups,shell\n# Example: jsmith,Jane Smith,developers;docker,\u002Fbin\u002Fbash\n\nCSV_FILE=\"${1:?Usage: $0 \u003Cusers.csv>}\"\n\nwhile IFS=',' read -r username fullname groups shell; do\n  # Skip header line\n  [[ \"$username\" == \"username\" ]] && continue\n\n  if id \"$username\" &>\u002Fdev\u002Fnull; then\n    echo \"SKIP: User $username already exists\"\n    continue\n  fi\n\n  # Replace semicolons with commas for -G flag\n  group_list=\"${groups\u002F\u002F;\u002F,}\"\n\n  useradd -m -s \"$shell\" -c \"$fullname\" -G \"$group_list\" \"$username\"\n  # Generate a random temporary password\n  temp_pass=$(openssl rand -base64 12)\n  echo \"$username:$temp_pass\" | chpasswd\n  chage -d 0 \"$username\"   # Force password change at first login\n\n  # Deliver the temporary secret only through an approved private channel.\n  # Never print it to terminal logs, CI output or the report.\n  unset temp_pass\n  echo \"CREATED: $username (groups: $group_list)\"\ndone \u003C \"$CSV_FILE\"\n```\n\n### Quick Access Audit Commands\n\n```bash\n# List non-system users (UID >= 1000)\nawk -F: '$3 >= 1000 && $3 \u003C 65534 { printf \"%-20s UID=%-6s Shell=%s\\n\", $1, $3, $7 }' \u002Fetc\u002Fpasswd\n\n# List users with sudo access\ngetent group sudo wheel 2>\u002Fdev\u002Fnull\n\n# Find accounts that have never logged in\nlastlog | awk '$0 ~ \u002FNever logged in\u002F { print $1 }'\n\n# Find empty password fields; ! indicates a locked field, not an empty password.\nawk -F: '$2 == \"\" { print $1 }' \u002Fetc\u002Fshadow 2>\u002Fdev\u002Fnull\n```\n\n## Troubleshooting\n\n| Symptom | Diagnostic Command | Common Fix |\n|---|---|---|\n| User cannot log in | `passwd -S username`, `faillock --user username` | Unlock account, reset password, check shell |\n| \"not in sudoers\" error | `sudo -l -U username` | Add user to sudo group or create sudoers.d file |\n| Group membership not applied | `id username`, `groups username` | User must log out and back in for new groups |\n| LDAP\u002FAD user not found | `id aduser`, `sssctl user-show aduser` | Check SSSD status, clear cache: `sss_cache -E` |\n| Permission denied on file | `ls -la file`, `getfacl file` | Fix ownership\u002Fpermissions, check SELinux context |\n| PAM lockout after failed attempts | `faillock --user username` | `faillock --user username --reset` |\n| Home directory not created | Check `\u002Fetc\u002Flogin.defs` CREATEHOME | Use `useradd -m` or enable `pam_mkhomedir` |\n| Password policy not enforced | Check `\u002Fetc\u002Fpam.d\u002Fcommon-password` | Install and configure `pam_pwquality` |\n\n## Related Skills\n\n- `linux-administration` -- General Linux server management\n- `ssh-configuration` -- SSH key-based authentication for managed users\n- `systemd-services` -- Service accounts and systemd user instances\n- `performance-tuning` -- Resource limits per user via cgroups and ulimits\n\n## Limitations\n\n- Infrastructure commands can disrupt services: confirm target host\u002Fscope and have backups\u002Fsnapshots before mutating state.\n- Docs-only import: upstream scripts and templates not bundled.\n\n","# User Management\n\nManage users, groups, permissions, sudo access, PAM modules, and LDAP integration on Linux systems. Includes practical scripts for bulk user operations and access auditing.\n\n## When to Use\n\n- Creating and managing local user accounts on Linux servers\n- Configuring sudo access with fine-grained privilege controls\n- Setting up group-based access control for teams\n- Integrating Linux hosts with LDAP or Active Directory for centralized auth\n- Auditing user accounts, permissions, and access patterns\n- Automating bulk user provisioning and deprovisioning\n\n## Prerequisites\n\n- Root or sudo access on the target system\n- `shadow-utils` package (provides useradd, usermod, etc.) -- installed by default\n- `libpam-modules` for PAM configuration\n- For LDAP: `sssd`, `realmd`, `libpam-ldapd`, or `nslcd` packages\n- For auditing: `auditd` package\n\n## User Operations\n\n### Creating Users\n\n```bash\n# Create a user with home directory, default shell, and comment\nuseradd -m -s \u002Fbin\u002Fbash -c \"Jane Smith\" jsmith\n\n# Set the user's password interactively\npasswd jsmith\n\n# Create a user with a specific UID and primary group\nuseradd -m -s \u002Fbin\u002Fbash -u 1500 -g developers -c \"Deploy Account\" deploy\n\n# Create a system account (no home, no login shell) for running services\nuseradd -r -s \u002Fusr\u002Fsbin\u002Fnologin -d \u002Fopt\u002Fmyapp -c \"MyApp Service Account\" myapp\n\n# Create a user with an expiration date (contractor access)\nuseradd -m -s \u002Fbin\u002Fbash -e 2025-12-31 -c \"Contractor - Bob Lee\" blee\n\n# Create user and add to multiple supplementary groups at creation time\nuseradd -m -s \u002Fbin\u002Fbash -G docker,developers,ssh-users -c \"Dev User\" devuser\n```\n\n### Modifying Users\n\n```bash\n# Add a user to a supplementary group (preserving existing groups with -a)\nusermod -aG sudo jsmith\nusermod -aG docker,developers jsmith\n\n# Change the user's login shell\nusermod -s \u002Fbin\u002Fzsh jsmith\n\n# Change the user's home directory and move existing files\nusermod -d \u002Fhome\u002Fjsmith-new -m jsmith\n\n# Lock the password only; SSH keys\u002Fother authentication may still work.\n# Full deprovisioning requires separately reviewing expiry, sessions and keys.\nusermod -L jsmith\n\n# Unlock a user account\nusermod -U jsmith\n\n# Set an account expiration date\nusermod -e 2025-06-30 blee\n\n# Change a user's login name\nusermod -l jsmith-new jsmith\n\n# Force password change on next login\nchage -d 0 jsmith\n\n# Set password aging: min 7 days, max 90 days, warn 14 days before\nchage -m 7 -M 90 -W 14 jsmith\n\n# View password aging info\nchage -l jsmith\n```\n\n### Deleting Users\n\n```bash\n# Remove a user and their home directory\nuserdel -r jsmith\n\n# Remove a user but keep their home directory (for auditing)\nuserdel jsmith\n\n# Find and reassign files owned by a deleted user (by UID)\nfind \u002F -uid 1500 -exec chown newowner:newgroup {} \\;\n```\n\n## Group Management\n\n```bash\n# Create a new group\ngroupadd developers\n\n# Create a group with a specific GID\ngroupadd -g 2000 devops\n\n# Add a user to a group\nusermod -aG developers jsmith\n# Alternative using gpasswd\ngpasswd -a jsmith developers\n\n# Remove a user from a group\ngpasswd -d jsmith developers\n\n# Set group administrators (can add\u002Fremove members without root)\ngpasswd -A jsmith developers\n\n# Delete a group\ngroupdel developers\n\n# List all groups a user belongs to\ngroups jsmith\nid jsmith\n\n# List all members of a group\ngetent group developers\n\n# Show all groups on the system\ncat \u002Fetc\u002Fgroup | cut -d: -f1 | sort\n```\n\n## Sudo Configuration\n\n```bash\n# Always edit sudoers via visudo (syntax validation prevents lockout)\nvisudo\n\n# Better: use drop-in files in \u002Fetc\u002Fsudoers.d\u002F\nvisudo -f \u002Fetc\u002Fsudoers.d\u002Fdevelopers\n```\n\n### \u002Fetc\u002Fsudoers.d\u002Fdevelopers\n\n```text\n# Allow the developers group to restart specific services\n%developers ALL=(ALL) NOPASSWD: \u002Fusr\u002Fbin\u002Fsystemctl restart myapp, \u002Fusr\u002Fbin\u002Fsystemctl status myapp\n\n# Allow a deploy user full sudo with no password\ndeploy ALL=(ALL) NOPASSWD: ALL\n\n# Allow ops team to run docker commands only\n%ops ALL=(ALL) NOPASSWD: \u002Fusr\u002Fbin\u002Fdocker, \u002Fusr\u002Fbin\u002Fdocker-compose\n\n# Allow a user to run commands as a specific service account\njsmith ALL=(myapp) NOPASSWD: \u002Fopt\u002Fmyapp\u002Fbin\u002F*\n\n# Restrict to specific hosts (useful with centralized sudoers)\njsmith dbservers=(root) \u002Fusr\u002Fbin\u002Fsystemctl restart postgresql\n\n# Log all sudo commands to a dedicated file\nDefaults log_output\nDefaults!\u002Fusr\u002Fbin\u002Fsudoreplay !log_output\nDefaults logfile=\"\u002Fvar\u002Flog\u002Fsudo.log\"\n\n# Require password re-entry every 5 minutes (default is 15)\nDefaults timestamp_timeout=5\n\n# !authenticate DISABLES password authentication; do not use it to require passwords.\n# Remove conflicting NOPASSWD grants and review explicit PASSWD command tags\n# with visudo; verify effective behavior using sudo -l and a separate test session.\n```\n\n```bash\n# Validate sudoers syntax without applying\nvisudo -c\n\n# Check what sudo permissions a user has\nsudo -l -U jsmith\n\n# Test a specific sudo command as a user\nsudo -u myapp \u002Fopt\u002Fmyapp\u002Fbin\u002Fhealthcheck.sh\n```\n\n## File Permissions and ACLs\n\n```bash\n# Standard permissions\nchmod 755 \u002Fopt\u002Fmyapp           # rwxr-xr-x\nchmod 640 \u002Fetc\u002Fmyapp.conf      # rw-r-----\nchmod u+x script.sh            # Add execute for owner\nchmod g+w shared-dir\u002F          # Add write for group\nchmod o-rwx private-file       # Remove all permissions for others\n\n# Change ownership\nchown deploy:developers \u002Fopt\u002Fmyapp\nchown -R deploy:developers \u002Fopt\u002Fmyapp\u002F   # Recursive\n\n# Set the SGID bit (new files inherit group ownership)\nchmod g+s \u002Fopt\u002Fshared\u002F\n\n# Set the sticky bit (only owner can delete their files)\nchmod +t \u002Ftmp\u002Fshared\u002F\n\n# Access Control Lists (ACLs) for fine-grained control\n# Grant read-execute to a specific user on a directory\nsetfacl -m u:jsmith:rx \u002Fopt\u002Fmyapp\u002Flogs\u002F\n\n# Grant read-write to a group\nsetfacl -m g:developers:rw \u002Fopt\u002Fshared\u002F\n\n# Set default ACL (applied to new files created in the directory)\nsetfacl -d -m g:developers:rw \u002Fopt\u002Fshared\u002F\n\n# View ACLs\ngetfacl \u002Fopt\u002Fshared\u002F\n\n# Remove a specific ACL entry\nsetfacl -x u:jsmith \u002Fopt\u002Fmyapp\u002Flogs\u002F\n\n# Remove all ACLs\nsetfacl -b \u002Fopt\u002Fshared\u002F\n```\n\n## PAM Configuration\n\nThe settings below are fragments for the named configuration files, not shell commands or a complete PAM stack. Use distro-supported profile tooling, preserve recovery access and validate authentication in a separate session. Do not append faillock lines without the required ordering\u002Fcontrol flow.\n\n```text\n# PAM config files are in \u002Fetc\u002Fpam.d\u002F\n# Each file controls auth for a specific service (sshd, login, sudo, etc.)\n\n# Enforce password complexity via pam_pwquality\n# \u002Fetc\u002Fpam.d\u002Fcommon-password (Debian) or \u002Fetc\u002Fpam.d\u002Fsystem-auth (RHEL)\npassword requisite pam_pwquality.so retry=3 minlen=12 dcredit=-1 ucredit=-1 ocredit=-1 lcredit=-1\n\n# Configure \u002Fetc\u002Fsecurity\u002Fpwquality.conf\nminlen = 12\ndcredit = -1\nucredit = -1\nocredit = -1\nlcredit = -1\nmaxrepeat = 3\ndictcheck = 1\n\n# Limit concurrent logins per user\n# \u002Fetc\u002Fsecurity\u002Flimits.conf\njsmith hard maxlogins 3\n@developers hard maxlogins 5\n\n# Lock account after 5 failed login attempts\n# \u002Fetc\u002Fpam.d\u002Fcommon-auth (Debian)\nauth required pam_faillock.so preauth silent deny=5 unlock_time=900\nauth required pam_faillock.so authfail deny=5 unlock_time=900\n\n# View failed login attempts\nfaillock --user jsmith\n\n# Unlock a locked account\nfaillock --user jsmith --reset\n```\n\n## LDAP \u002F Active Directory Integration\n\n```bash\n# Install SSSD and realmd for AD integration (Ubuntu\u002FDebian)\napt install -y sssd realmd adcli sssd-tools libnss-sss libpam-sss\n\n# Install SSSD and realmd (RHEL\u002FCentOS)\ndnf install -y sssd realmd adcli sssd-tools oddjob oddjob-mkhomedir\n\n# Discover and join an Active Directory domain\nrealm discover corp.example.com\nrealm join corp.example.com -U admin@CORP.EXAMPLE.COM\n\n# Verify the join\nrealm list\n\n# Allow specific AD groups to log in\nrealm permit -g \"Linux Admins@corp.example.com\"\nrealm permit -g \"Developers@corp.example.com\"\n\n# Deny all except permitted groups\nrealm deny --all\nrealm permit -g \"Linux Admins@corp.example.com\"\n\n# Restart SSSD after config changes\nsystemctl restart sssd\n\n# Test LDAP user lookup\nid jsmith\ngetent passwd jsmith\n\n# Grant sudo to an AD group\necho '%linux\\ admins ALL=(ALL) ALL' > \u002Fetc\u002Fsudoers.d\u002Fad-admins\n```\n\n## Bulk User Management Scripts\n\n### Bulk User Creation from CSV\n\nIllustrative simple CSV only: reject headers\u002Fempty rows, option-like usernames, unapproved groups and shells before running. Use a proper CSV parser for quoting\u002Fcommas. Add fail-fast handling and stop on any useradd\u002Fchpasswd\u002Fchage failure; never continue as if provisioned. Docker group\u002FCLI access and broad sudo are effectively privileged, not restricted application access. Do not grant these examples without explicit role authorization.\n\n```bash\n#!\u002Fbin\u002Fbash\nset -euo pipefail\n# bulk-create-users.sh\n# CSV format: username,fullname,groups,shell\n# Example: jsmith,Jane Smith,developers;docker,\u002Fbin\u002Fbash\n\nCSV_FILE=\"${1:?Usage: $0 \u003Cusers.csv>}\"\n\nwhile IFS=',' read -r username fullname groups shell; do\n  # Skip header line\n  [[ \"$username\" == \"username\" ]] && continue\n\n  if id \"$username\" &>\u002Fdev\u002Fnull; then\n    echo \"SKIP: User $username already exists\"\n    continue\n  fi\n\n  # Replace semicolons with commas for -G flag\n  group_list=\"${groups\u002F\u002F;\u002F,}\"\n\n  useradd -m -s \"$shell\" -c \"$fullname\" -G \"$group_list\" \"$username\"\n  # Generate a random temporary password\n  temp_pass=$(openssl rand -base64 12)\n  echo \"$username:$temp_pass\" | chpasswd\n  chage -d 0 \"$username\"   # Force password change at first login\n\n  # Deliver the temporary secret only through an approved private channel.\n  # Never print it to terminal logs, CI output or the report.\n  unset temp_pass\n  echo \"CREATED: $username (groups: $group_list)\"\ndone \u003C \"$CSV_FILE\"\n```\n\n### Quick Access Audit Commands\n\n```bash\n# List non-system users (UID >= 1000)\nawk -F: '$3 >= 1000 && $3 \u003C 65534 { printf \"%-20s UID=%-6s Shell=%s\\n\", $1, $3, $7 }' \u002Fetc\u002Fpasswd\n\n# List users with sudo access\ngetent group sudo wheel 2>\u002Fdev\u002Fnull\n\n# Find accounts that have never logged in\nlastlog | awk '$0 ~ \u002FNever logged in\u002F { print $1 }'\n\n# Find empty password fields; ! indicates a locked field, not an empty password.\nawk -F: '$2 == \"\" { print $1 }' \u002Fetc\u002Fshadow 2>\u002Fdev\u002Fnull\n```\n\n## Troubleshooting\n\n| Symptom | Diagnostic Command | Common Fix |\n|---|---|---|\n| User cannot log in | `passwd -S username`, `faillock --user username` | Unlock account, reset password, check shell |\n| \"not in sudoers\" error | `sudo -l -U username` | Add user to sudo group or create sudoers.d file |\n| Group membership not applied | `id username`, `groups username` | User must log out and back in for new groups |\n| LDAP\u002FAD user not found | `id aduser`, `sssctl user-show aduser` | Check SSSD status, clear cache: `sss_cache -E` |\n| Permission denied on file | `ls -la file`, `getfacl file` | Fix ownership\u002Fpermissions, check SELinux context |\n| PAM lockout after failed attempts | `faillock --user username` | `faillock --user username --reset` |\n| Home directory not created | Check `\u002Fetc\u002Flogin.defs` CREATEHOME | Use `useradd -m` or enable `pam_mkhomedir` |\n| Password policy not enforced | Check `\u002Fetc\u002Fpam.d\u002Fcommon-password` | Install and configure `pam_pwquality` |\n\n## Related Skills\n\n- `linux-administration` -- General Linux server management\n- `ssh-configuration` -- SSH key-based authentication for managed users\n- `systemd-services` -- Service accounts and systemd user instances\n- `performance-tuning` -- Resource limits per user via cgroups and ulimits\n\n## Limitations\n\n- Infrastructure commands can disrupt services: confirm target host\u002Fscope and have backups\u002Fsnapshots before mutating state.\n- Docs-only import: upstream scripts and templates not bundled.\n\n",{"name":5,"risk":29,"source":50,"license":14,"category":51,"metadata":52,"date_added":55,"description":7,"source_repo":56,"source_type":33,"compatibility":57,"license_source":58},"https:\u002F\u002Fgithub.com\u002FBagelHole\u002FDevOps-Security-Agent-Skills","devops",{"author":53,"version":54},"devops-skills","1.0","2026-09-20","BagelHole\u002FDevOps-Security-Agent-Skills","Requires the relevant OS\u002Fplatform tooling and privileged access where noted. Docs-only; helper scripts and templates not bundled.","https:\u002F\u002Fgithub.com\u002FBagelHole\u002FDevOps-Security-Agent-Skills\u002Fblob\u002Fmain\u002FLICENSE","7bf2279c8a65758319526a721d5c4b75683aec9c","skills\u002Fantigravity-user-management",3,"https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections","https:\u002F\u002Fgithub.com\u002Fboisenoise","2026-11-14 14:18:11",{"source":8,"skillName":5,"commands":66,"prompt":76,"zipAvailable":77},[67,70,73],{"tool":68,"command":69},"npx","npx skills add boisenoise\u002Fskills-collections --skill user-management",{"tool":71,"command":72},"bunx","bunx skills add boisenoise\u002Fskills-collections --skill user-management",{"tool":74,"command":75},"pnpm","pnpm dlx skills add boisenoise\u002Fskills-collections --skill user-management","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-user-management\u002FSKILL.md",true,[],[80,89,97,106,114,122],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":84,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":88},"01M7B6HREHB53EHGGVZND7DDXN","scrapely-scrape","Collect web data with ready-made Scrape.ly scrapers: Google Maps places, Amazon products, LinkedIn jobs, reviews, social posts. Use when the user wants structured data from a site.","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-scrapely-scrape\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-scrapely-scrape\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":93,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":88},"01M7B6GDNNN4HE662KA6KPF7GW","lumify-odds","Lumify's hosted sports MCP\u002FREST API for sportsbook odds, line-movement history, public betting splits, and player props across MLB, NFL, NBA, NHL, soccer, tennis, NCAAF, NCAAB. Read-only market data.","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-lumify-odds\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-lumify-odds\u002FSKILL.md",[],[],{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":101,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":105},"01M743PZMJW2GEKG5J199GPSK7","sync-lipsync","Lip-sync an existing video of a real person to new audio or a typed script with sync. labs through its hosted MCP server, quoting the cost and waiting for approval first.","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-sync-lipsync\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-sync-lipsync\u002FSKILL.md",[],[],"2026-11-11 15:11:14",{"skillNo":107,"name":108,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":110,"sourceHtmlUrl":111,"categories":112,"keywords":113,"publishedAt":105},"01M743MMN3CKTJVNRSZMB684E5","music-for-robots","Optional music-inspired creative exercise for multimodal agents. Ingests an unquantized acoustic MP3 composition by Michael Luchtan (Music For Robots) into a private temporary directory, analyzing microtiming and texture to inspire creative writing, brainstorming, or technical tasks.","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-music-for-robots\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-music-for-robots\u002FSKILL.md",[],[],{"skillNo":115,"name":116,"nameZh":6,"description":117,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":118,"sourceHtmlUrl":119,"categories":120,"keywords":121,"publishedAt":105},"01M743KC2GN5WE11BSTWSSWD8B","imagera-media","Generate or edit images, video clips, voiceovers and music through the hosted Imagera MCP server, quoting the credit cost and getting approval before each paid call.","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-imagera-media\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-imagera-media\u002FSKILL.md",[],[],{"skillNo":123,"name":124,"nameZh":6,"description":125,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":126,"sourceHtmlUrl":127,"categories":128,"keywords":129,"publishedAt":105},"01M743HDJNZQA8A4VT68NWGWQJ","deja-history","Search this machine's past AI coding sessions across Claude Code, Codex, Cursor, Gemini CLI and thirty-nine other agents before editing, debugging, or denying something exists.","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-deja-history\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-deja-history\u002FSKILL.md",[],[]]