user-permissions
Linux user and permission management
What this skill does
# User and Permission Management ## Overview Linux user management, group management, sudo configuration, ACL permissions and other skills. ## User Management ### View Users ```bash # Current user whoami id # User information id username finger username # All users cat /etc/passwd getent passwd # Logged in users who w last # Login history ``` ### User Operations ```bash # Create user useradd username useradd -m -s /bin/bash username # Create home directory, specify shell useradd -G group1,group2 username # Specify supplementary groups # Modify user usermod -aG groupname username # Add to group usermod -s /bin/zsh username # Change shell usermod -L username # Lock user usermod -U username # Unlock user # Delete user userdel username userdel -r username # Also delete home directory # Change password passwd username passwd -l username # Lock password passwd -u username # Unlock password chage -l username # View password policy ``` ## Group Management ### View Groups ```bash # User's groups groups username id -Gn username # All groups cat /etc/group getent group # Group members getent group groupname ``` ### Group Operations ```bash # Create group groupadd groupname groupadd -g 1001 groupname # Specify GID # Modify group groupmod -n newname oldname # Rename # Delete group groupdel groupname # Manage group members gpasswd -a username groupname # Add user gpasswd -d username groupname # Remove user gpasswd -M user1,user2 groupname # Set member list ``` ## sudo Configuration ### Basic Usage ```bash # Execute as root sudo command sudo -i # Switch to root shell sudo -u username command # Execute as another user # View permissions sudo -l ``` ### sudoers Configuration ```bash # Edit sudoers (recommended method) visudo # Or edit files under /etc/sudoers.d/ visudo -f /etc/sudoers.d/username ``` ### Common Configuration Examples ```bash # /etc/sudoers.d/username # Full privileges username ALL=(ALL:ALL) ALL # No password required username ALL=(ALL) NOPASSWD: ALL # Specific commands username ALL=(ALL) /usr/bin/systemctl restart nginx # Specific commands without password username ALL=(ALL) NOPASSWD: /usr/bin/docker # Group privileges %groupname ALL=(ALL) ALL ``` ## ACL Permissions ### View ACL ```bash getfacl file getfacl -R dir # Recursive view ``` ### Set ACL ```bash # Set user permissions setfacl -m u:username:rwx file setfacl -m u:username:rx dir # Set group permissions setfacl -m g:groupname:rx file # Set default ACL (new files inherit) setfacl -d -m u:username:rwx dir # Recursive set setfacl -R -m u:username:rx dir # Remove ACL setfacl -x u:username file # Remove specific setfacl -b file # Remove all ``` ## Special Permissions ### SUID/SGID/Sticky ```bash # SUID (4) - Execute as file owner chmod u+s file chmod 4755 file # SGID (2) - Execute as file group/directory inherits group chmod g+s file chmod 2755 dir # Sticky (1) - Only owner can delete chmod +t dir chmod 1777 dir # View ls -la # -rwsr-xr-x SUID # -rwxr-sr-x SGID # drwxrwxrwt Sticky ``` ## Common Scenarios ### Scenario 1: Create Developer User ```bash # Create user and group groupadd developers useradd -m -s /bin/bash -G developers devuser # Set password passwd devuser # Configure sudo echo "devuser ALL=(ALL) NOPASSWD: /usr/bin/docker, /usr/bin/systemctl" > /etc/sudoers.d/devuser chmod 440 /etc/sudoers.d/devuser ``` ### Scenario 2: Shared Directory Permissions ```bash # Create shared directory mkdir /shared groupadd shared chown root:shared /shared chmod 2775 /shared # SGID ensures new files inherit group # Add users to group usermod -aG shared user1 usermod -aG shared user2 ``` ### Scenario 3: Restrict User to Specific Commands ```bash # /etc/sudoers.d/limited-user limited ALL=(ALL) NOPASSWD: /usr/bin/systemctl status *, /usr/bin/journalctl ``` ## Troubleshooting | Problem | Solution | |---------|----------| | sudo permission denied | Check `/etc/sudoers.d/` configuration | | User cannot login | Check shell, password lock status | | Group permissions not working | Re-login or `newgrp groupname` | | ACL not working | Check if filesystem supports ACL |
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.