Module 5 - User,groups and permission
Module 5 - User,groups and permission
Module 5
Managing users, groups and
permission
Thu Ya
• cat /etc/passwd | wc –l
• Uid above 1000 are user account, below 1000 are system
accounts.
1
11/2/2024
Disabling an Account
• You may find yourself needing to disable an account (lock out a user) as a disciplinary measure, for the
purposes of an investigation, or simply in the event of a prolonged or definitive absence of a user. A disabled
account means the user cannot login or gain access to the machine. The account remains intact on the
machine and no files or data are deleted; it is simply inaccessible. This is accomplished by using the
command passwd -l user (lock). Re-enabling the account is done in similar fashion, with the -uoption
(unlock).
2
11/2/2024
/etc/passwd
/etc/shadow
• Password hash are store in the file
3
11/2/2024
Create a group
• groupadd group1
• groupdel group1
• Two type of group, primary and secondary
• Primary group is group for the user when first assign
• Secondary group are extra group which use have been assigned to
Group commands
• gpasswd –a “username” “groupname”
4
11/2/2024
Linux permission
• Ls –l
• D mean directory , - mean it is a file
• D rwx r-x r-x
• 2nd group is user that own the folder
• 3rd group is group that own the folder