Linux Users And Groups Admin Flashcards
How would you add a user John Doe?
useradd -c COMMENT/FULLNAME -e YEAR/MONTH/DAY -s SHELL PATH -d /HOME PATH jdoe
Where
-c is to add a comment (frequently full name)
-e gives an expiry date
-s specifies a shell
-d specifies home directory (tho you need to create if you use this and don’t go with default)
How do you change your group context (the group your CL is presently operating in)?
newgrp GROUPNAME
or
chown USER:GROUP FILE
How do you find out what groups someone is in?
sudo id USER
groups (for yourself)
Or check /etc/passwd or etc/group
What is umask?
User file-creation mode Mask is used to set default file and dir permissions.
What is FACL?
File System Access Control List
Where do you go to manage default password/login settings
/etc/login.defs
What is PAM?
Plug-in Authentication Module
How to change the file or directory group (2 ways)
chgrp GROUP FILE
chown USER:GROUP FILE
Change file or directory ownership
chown USER FILE
Change permissions symbolically
chmod (u/g/o) (+/-/=) (r/w/x) FILE
Change permissions with octal method
chmod OCTAL FILE
- - - = 0
- - x = 1
- w - =2
r - - = 4
What is the Set User ID (SUID) Bit?
Used on executables , it tells kernel to run with owner permission for standard users.
Indicated by an s instead of x for the owner.
In octal set 4- - -
What is the Set Group ID (SGID) bit?
For files - run executable with groups permissions. Shows as and s instead of x for group
In octal set 2- - -
For directories - ensure new files created in a directory are set to directory group permission and not user permission which is better for sharing.
What is the sticky bit?
Used to protect a file from deletion by those that don’t own it. Shoes by a ‘t’ instead of ‘x’ for ‘others’
In octal mode set 1- - -
What are the umask octal codes
Files. Dirs
027 - rw- r- - - - - rwx r-x - - -