group and user management
Sharon is a RHEL Sysadmin at Ford Motors. She supports the Mustang Mach-E Group. Her supervisor has tasked her with the following (she will NOT use the root account, so sudo should be used when necessary):
- Create a new group called junior_developers.
- Create the following new users: ptahs, jamess, kilaw, and ovettas.
- Each new user should use bash shell , and the default home directory should be created.
- Each new user should be forced to change their password every 90 days, and each new user should have a minimum pasword length of 15 characters.
- Please show all commands needed to meet these objectives.
Here are the commands that Sharon can use to meet her objectives:
- Create a new group called junior_developers:
- sudo groupadd junior_developers
- Create new users ptahs, jamess, kilaw, and ovettas with bash shell and default home directory:
- sudo useradd -m -s /bin/bash ptahs
- sudo useradd -m -s /bin/bash jamess
- sudo useradd -m -s /bin/bash kilaw
- sudo useradd -m -s /bin/bash ovettas
- Set password policies for all new users to force password changes every 90 days and minimum password length of 15 characters:
- sudo chage --maxage 90 ptahs
- sudo chage --maxage 90 jamess
- sudo chage --maxage 90 kilaw
- sudo chage --maxage 90 ovettas
- sudo passwd --minlen 15 ptahs
- sudo passwd --minlen 15 jamess
- sudo passwd --minlen 15 kilaw
- sudo passwd --minlen 15 ovettas
Note: The chage
command is used to set the maximum password age for a user account. The passwd
command with the --minlen
option is used to set the minimum password length for a user account.