Here are some essential user management commands in Linux:
-
adduser/useradd: Create a new user account.- Example:
sudo adduser newuser
- Example:
-
usermod: Modify an existing user account (e.g., change username, home directory, or group membership).- Example:
sudo usermod -l newname oldname
- Example:
-
deluser/userdel: Remove a user account.- Example:
sudo deluser username
- Example:
-
passwd: Change a user's password.- Example:
sudo passwd username
- Example:
-
chage: Change user password expiry information.- Example:
sudo chage -E 2023-12-31 username
- Example:
-
groups: Display the groups a user belongs to.- Example:
groups username
- Example:
-
id: Show user ID (UID) and group ID (GID) information.- Example:
id username
- Example:
-
su: Switch to another user account.- Example:
su - username
- Example:
-
who: Show who is currently logged into the system. -
w: Display who is logged in and what they are doing.
These commands are fundamental for managing user accounts and permissions in a Linux environment. If you need more details or examples for any specific command, feel free to ask!
