Skip to content

Commit c9ef7ee

Browse files
Update Users and Accounts.md
1 parent 3d51747 commit c9ef7ee

1 file changed

Lines changed: 24 additions & 2 deletions

File tree

DFIR/Digital Forensics/Linux/Users and Accounts.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# User Accounts (/etc/passwd)
1+
## User Accounts (/etc/passwd)
22
The /etc/passwd file is a fundamental system file in Unix-like operating systems, including Linux. It stores essential information about user accounts on the system. Each line in the file represents a user account and is formatted with several fields separated by colons (:). Here's a typical structure of a line in /etc/passwd:
33

44
```bash
@@ -14,7 +14,7 @@ username:password:UID:GID:GECOS:home_directory:login_shell
1414
| home_directory | The user's home directory, where they are placed upon login. |
1515
| login_shell | The default shell for the user, which determines the command interpreter environment when the user logs in. |
1616

17-
# Groups
17+
## Groups Information (/etc/group)
1818
The `/etc/group` stores information about groups on the system, including group names and their associated group IDs (GIDs), as well as the list of users who belong to each group. Similar to /etc/passwd, each line in /etc/group represents a group and is formatted with several fields separated by colons (:). Here's the typical structure of a line in /etc/group:
1919
```bash
2020
group_name:password:GID:user_list
@@ -25,3 +25,25 @@ group_name:password:GID:user_list
2525
| password | Historically, this field used to store the encrypted group password. However, it's rarely used nowadays, and an 'x' character is typically placed here to indicate that the actual password is stored in the /etc/gshadow file. |
2626
| GID | The numerical Group ID, a unique identifier for the group. |
2727
| user_list | A comma-separated list of usernames that are members of the group. |
28+
29+
## Sudoers List (/etc/sudoers)
30+
The `/etc/sudoers`controls who can run what commands as root (or as any other user) on a system with the sudo command. The sudo command allows a permitted user to execute a command as the superuser (root) or another user, as specified in the /etc/sudoers file. The /etc/sudoers file can be edited only by users with root privileges and should be modified with care to avoid inadvertently granting excessive permissions. The file uses a specific syntax that allows specifying rules and configurations for sudo access.
31+
32+
```sql
33+
# User privilege specification
34+
root ALL=(ALL:ALL) ALL
35+
36+
# Members of the admin group may gain root privileges
37+
%admin ALL=(ALL) ALL
38+
39+
# Allow members of group sudo to execute any command
40+
%sudo ALL=(ALL:ALL) ALL
41+
42+
# Allow users in wheel group to execute any command
43+
%wheel ALL=(ALL) ALL
44+
45+
# Allow user john to execute /bin/ls as root without a password
46+
john ALL=(ALL) NOPASSWD: /bin/ls
47+
```
48+
49+

0 commit comments

Comments
 (0)