Linux & shell: Users & groups
6 Linux & shell commands: Users & groups. Click a command to see what each part does.
Linux & shell: Users & groupsIndex
- Whole sheet251
- Navigate & list13
- Create, copy, move, delete13
- View & compare files9
- Permissions & ownership31
- Help & shell basics11
- Users & groups6
- Install packages7
- Package & software versions29
- System info9
- Network basics & SSH10
- Zip & compress4
- Shell operators6
- Processes6
- Files & search8
- Text processing pipelines4
- Disk3
- Network5
- Services & logs6
- Archives & copying4
- Firewall7
- Scheduling: cron & systemd timers6
- Storage, mounts & LVM10
- Kernel, hardware & limits8
- Performance & tracing10
- TLS & certificates8
- Packet capture & network debugging10
- Terminal tools8
Users & groups6
whoami; idWho am I?What each part does
whoamiyour user nameidyour user ID, primary group and all groups
groups <user>Which groups is a user in?What each part does
groupslist group memberships (yours if no user given)
su - <user>Switch to another userWhat each part does
susubstitute user-start a full login shell (their home folder and environment)
sudo useradd -m -s /bin/bash <user>Create a user with a home folder and bashWhat each part does
useraddcreate a user account-m--create-home: create /home/<user> with the skeleton files-s /bin/bash--shell: login shell
sudo usermod -aG <group> <user>Add a user to a group (keep other groups)What each part does
usermodmodify a user-a--append: add to the group (only valid with -G)-G <group>supplementary group(s). Without -a the user is REMOVED from groups not listed
Tip Typical: sudo usermod -aG docker $USER, then log out and in again.
sudo passwd <user>Set or change a passwordWhat each part does
passwdchange the password (your own if no user given, no sudo needed)
Nothing matches.
My DevOps Playbook by Angelo John Calleja