Chapter 6 - User and Group Management Flashcards
Which command to use to get information about a user account?
id
Example: id linda
What are the various ways to run tasks with elevated permissions?
Method Description
- su = Opens a subshell as a different user, with the advantage that commands are executed as root only in the subshell
- sudo = Enables you to set up an environment where specific tasks are executed with administrative privileges
- PolicyKit = Enables you to set up graphical utilities to run with administrative privileges
What is the difference between “su -“ and just “su”?
When you use “su” from a shell, The subshell that is started when using su is an environment where you are able to work as the target user account, but environment settings for that user account have not been set.
If you need complete access to the entire environment of the target user account, you can use su - to start a login shell. If you start a login shell, all scripts that make up the user environment are processed, which makes you work in an environment that is exactly the same as when logging in as that user.
Using su - is better than using su. When the - is used, a login shell is started; without the -, some variables may not be set correctly
How to assign administrative persmissions to a user only for running specific commands?
sudo
the system administrator can configure sudo to
give that user administrator permissions to perform the specific task.
use “visudo” to edit the sudoers configuration file and give user access to specific commands only
For example, if you would include the line linda
ALL=/usr/bin/useradd, /usr/bin/passwd in this file, that would allow user linda to run only the commands useradd and passwd with administrative privileges
What is policykit?
Most administration programs with a graphical user interface use PolicyKit to authenticate as the root user.
What command to create a user laura who is a member of the group wheel
useradd -G wheel laura
What are the two types of user accounts in Linux?
System Accounts and Normal Accounts
What is a Normal account in Linux?
normal user accounts for the people who need to work on a server and who need limited access to the resources on that server
What is a system account in Linux?
system accounts that are used by the services the server is offering.
In which directory or configuration files are the properties of the user accounts saved?
/etc/passwd
/etc/shadow
What are the different fields in the /etc/passwd file?
Username Password UID GID Comment field Directory Shell
What is the file /etc/shadow used for?
One part of the user configuration is stored in the /etc/passwd file and another part of the user configuration is stored in the file /etc/shadow. The settings in this file are used to set properties of the password. Only the user root and processes running as root have access to /etc/shadow
What are the various fields in the /etc/shadow file?
- Login name
- Encrypted password
- Days since Jan. 1, 1970, that the password was last changed
- Days before password may be changed
- Days after which password must be changed
- Days before password is to expire that user is warned
- Days after password expires that account is disabled
- Days since Jan. 1, 1970, that account is disabled
- A reserved field, which was once added “for future use”
What are the commands that can be used to manage password properties?
passwd or chage
What is the command to edit the contents of the /etc/passwd and /etc/shadow configuration files directly?
vipw
What are the different ways of creating or adding new users in linux?
vipw –> used to directly edit the contents of passwd or shadow file
useradd command