Chap 2 Linux Sysadmin Part 3 Users and Group Management Students Version
Chap 2 Linux Sysadmin Part 3 Users and Group Management Students Version
University of Buea
Faculty of Engineering and Technology
Department of Computer Engineering Course content
• Chap 1 :Introduction to system administration: Fundamentals and
principles
1 2
3 4
3 4
1
10/11/2023
Unix files
Other useful Linux commands
• history: list the commands that you have issued.
• du: find the amount of space taken by a file or directory
• du * : find the file and directory sizes in the current location in a
human readable format
• echo > file : empty a file without deleting it
Users and group management
5 6
5 6
7 8
2
10/11/2023
User administration files: /etc/passwd file User administration files: /etc/passwd file
Login name Login name best practices
• It must be unique on the system • Should be no more than 8 characters for backward compatibility with
legacy systems.
• It cannot contain colons (:) or the newline character(\n) as these have
meanings in the passwd file • Should be all in lower case for consistency
• Linux allows up to 32 characters to form a login name. it also requires • Should not be nicknames; so as not to affect the organization’s image.
the first character to be a lower-case letter or an underscore. Often nicknames are used for e-mails.
• Linux accepts characters from a to z, both lower and upper case, in • It’s wise to use a naming scheme.
addition to dashes (-) and underscores (_). E.g. first initial dot last name.
9 10
9 10
11 12
11 12
3
10/11/2023
User administration files :/etc/passwd file User administration files /etc/passwd file
User Identification (UID) Group Identification (GID)
• Used to identify groups by number
• Users are defined by their names only for the benefit of users. All • Only the primary group is listed
applications and filesystems use the UID to identify users on Linux. • The root group GID is 0
• The root has UID of 0. • System users are also assigned to groups
• Although the system permits having multiple users with the same UID, • GID are mainly used to share files among users
it is highly not recommended, especially for the root account. • If setgid is used, any file created in the directory will bear the group id
• It is advised to have the unique UID’s across the entire network. This of this directory instead of it’s own
ensures that every person has the same UID on any system. Such a • Syntaxes:
control will mitigate potential security vulnerabilities when sharing
files, like through NFS for example. • “id –g” or “id –g user” : Find the group id of the current user or of a
specified user
13 14
13 14
15 16
15 16
4
10/11/2023
17 18
19 20
5
10/11/2023
21 22
21 22
23 24
23 24
6
10/11/2023
25 26
27 28
7
10/11/2023
29 30
31 32
8
10/11/2023
33 34
35 36
9
10/11/2023
37 38
39 40
10
10/11/2023
41
41 42
11