Advanced User Man Flashcards
Set password aging parameters for user100 to mindays 7, maxdays 28, and warndays 5:
chage -m 7 -M 26 -W 5 user100
show pasword aging settings
chage -l user100
Set the account expiry to Jan 31 2020
chage -E 2020-01-31 user100
Set password aging attributes for user200 to mindays 10, maxdays 90, and warndays 14:
**with passwd
passwd -n 10 -x 90 -w 14 user200
see passwd status
passwd -S user200
set the number of inactivity days to 5
passwd -i5 user200
for user to change password at next login
passwd -e user200
lock a user
usermod -L user200
passwd -l user200
unlock user
usermod -U user200
passwd -u user200
Create the group linuxadm with GID 5000:
groupadd -g 5000 linuxadm
Create a group called dba with the same GID as that of group linuxadm:
groupadd -o -g 5000 dba
-o is needed as it is ‘non-standard’ and has the same GID as another group. Inherits same perms as other group
where are groups stored
/etc/groups
Add user1 as a secondary member of group dba using the usermod command. The existing membership for the user must remain intact.
usermod -aG dba user1
confirm user1 is in dba group
grep dba /etc/group
id user1
groups user1
alter name of linuxadm group to sysadm
groupmod -n sysadm linuxadm