You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: DFIR/Digital Forensics/Linux/Users and Accounts.md
+24-2Lines changed: 24 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# User Accounts (/etc/passwd)
1
+
##User Accounts (/etc/passwd)
2
2
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:
| home_directory | The user's home directory, where they are placed upon login. |
15
15
| login_shell | The default shell for the user, which determines the command interpreter environment when the user logs in. |
16
16
17
-
# Groups
17
+
##Groups Information (/etc/group)
18
18
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:
| 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. |
26
26
| GID | The numerical Group ID, a unique identifier for the group. |
27
27
| 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
0 commit comments