- Users & Group ID Numbers
- Users & Group Informations Files
- Users Management Tools
- System Users and Groups
- Monitoring Logins
- Default Permissions
- Special Permissons For Executables
Users & Group ID Numbers
- When Files Are Stored On The Computer, The Metadata About The File Is Stored Numerically.
- That Is, The Username And Group Affiliation Of The File Are Not Stored; Rather, The User ID And Group ID Numbers Are Stored.
Users & Group Informations Files
/etc/passwdfile contains the list of the system’s accounts.
NOTE!: GID Is The User’s Primary Group ID Number
/etc/shadowfile contains the users encrypted passwords and account expiration information.
/etc/shadowfile is not readable by anyone.
/etc/groupfile defines the groups on the system
NOTE!: UserList Is The List Of Usernames That Are Members Of This Group, Separated By The Commas.
/etc/gshadowfile contains the groups encrypted passwords and the list of group administrators.
/etc/gshadowfile is not readable by anyone.
Users Management Tools
useradd: Create a new user or update default new user information
usermod: Modify a user account
userdel[-r]: Delete a user account [Removes users Home Directory and users Mail Spool]
- System -> Administration -> Users and Groups
- Add Modify Deletes Users and Groups
System Users and Groups
In additions to the ordinary user accounts and the superuser root account, The number of system users and groups exist.
- The main reason for creating system users and groups is, Runs several programs as non-priviledged users or as a particular groups. Examples: Daemon, mail, lp, nobody, web or print servers
Running programs in this way limits the amount of damage any single program can do to the system.
- System Users & Groups All Have UID & GID Numbers Between The 1 & 499.
w: Show who is logged on and what they are doing.
last: Show listing of last logged in users and reboot history.
lastb: Show bad login information.
lastlog: Reports the most recent login of all users or of a given user
lastlog -u root;
Files: 0666 - umask Directory: 0777 - umask
Non-privileged user’s umask is 0002
Files: 0666 - 0002 = 0664 Directory: 0777 - 0002 = 0775
Root user’s umask is 0022
Files: 0666 - 0022 = 0644 Directory: 0777 - 0022 = 0755
Changing umask value
NOTE!: The umask is typically set by the scripts run at the login time.
That means your umask value is set to default everytime you login into the system.
Special Permissons For Executables
In addition to the user, group and other permissions, An additional set of permissions exist called special permissions.
- 4(s) The suid - set user id bit
- 2(s) The sgid - set group id bit
- 1(t) The sticky bit
The special permission is displayed in the place of x.
- Small Letter = Executable Permission + Special Permission
- Capital Letter = No Executable Permission Only Special Permission
The SUID Permissions
- The command will run with the authority of the owner of the file, Rather than, the authority of the user running the command.
passwd command changes a user’s password,
which is stored in the
/etc/shadow file and it is not writable for non-privileged users.
However, since the
passwd command is owned by
root and runs with the
suid permissions, Users running the command have the
root privilege while changing their passwords.
Hence, They have the permissions to edit the
The SGID Permissions
- The command will run with the authority of the group of the file.
The SGID Permissions
- The files created in this directory will inherit its group affiliation from the directory, Rather than inheriting it from the user.
- The SGID Bit is commonly set for the Group Directories.
The Sticky Bit
- The Sticky Bit For A Directory, Sets A Special Restriction On Deletion Of Files.
- If the sticky bit is set for the directory, Then only the owner of the files or root can delete the files - Regardless of the write permissions of the directory.
- An Example of sticky bit set is