107.1. Manage user and group accounts and related system files
Description: Candidates should be able to add, remove, suspend and change user accounts.
Key Knowledge Areas:
- Add, modify and remove users and groups
- Manage user/group info in password/group databases
- Create and manage special purpose and limited accounts
Terms and Utilities:
The passwd command changes passwords for user accounts. A normal user can only change the password for their own account, but the superuser can change the password for any account.
- 1.Before a normal user can change their own password, they must first enter their current password for verification. (The superuser can bypass this step when changing another user's password.)
- 2.After the current password has been verified, passwd checks to see if the user is allowed to change their password at this time or not. Then user is then prompted twice.
- 3.Next, the password is tested for complexity.passwords should consist of at least 6 characters.
The root user can change any users password to anything (weak passwords) without providing their current password:
Groups can also have passwords, which you set with the
gpasswdcommand, but it is not used at all!
We have learned that Linux is a multiuser system.Recall that we can log in as one user and become another user by using the su or sudo commands.
Linux also has the concept of groups .
- each user belongs to one primary group and possibly to additional groups.
- Each file belongs to one user and one group
We learn how to create, delete, and manage users and groups.
We add a user to a Linux system with the
useradd <options> <username_or_login>
In most distributions useradd creates home directory for the new user but we can make sure using -m switch. example(ubunru 16):
We can use the
usermodcommand to modify a user account. we can use most of the options that you use with
useradd, except that you cannot create or populate a new home directory for the user.
usermod <options> <username_or_login>