| File Path | Description |
|---|---|
/etc/passwd |
Stores user account information |
/etc/shadow |
Stores user passwords and password aging data |
/etc/group |
Stores group information |
/etc/sudoers |
Defines users/groups allowed to run sudo |
-
View user info:
grep -i ^bob /etc/passwd
Example Output:
bob:x:1002:1002::/home/bob:/bin/shUSERNAME:PASSWORD:UID:GID:GECOS:HOMEDIR:SHELL -
Change password:
passwd # For current user passwd <username> # For specific user
-
Delete a user:
userdel <username>
-
View password entry:
grep -i ^bob /etc/shadow
Example Output:
bob:$6$...:18188:0:99999:7:::USERNAME:PASSWORD:LASTCHANGE:MINAGE:MAXAGE:WARN:INACTIVE:EXPDATE
-
Add a group:
groupadd <groupname>
-
Delete a group:
groupdel <groupname>
-
View user's group memberships:
grep -i ^bob /etc/group
GROUPNAME:PASSWORD:GID:MEMBERS -
Reset the shell Cache
hash -r