RHCSA Exam EX200 Cheat Sheet Part 1

User/Group management

GUI Tool

system-config-user

Add user account

useradd -c "full name" username

Add user account /w C Shell

useradd -s /bin/tcsh username

Add user account under a specify folder

useradd -c "full name" -d /home/accounting/username username

Add user name + group assignment

useradd -G groupname username

Add user /w password

useradd -p password username

Change user id

usermod -u UID username

Change user name

usermod -l newname oldname

Remove user account along with user’s directory and mailbox file

userdel -r username

Remove user’s directory

rm -rf /home/username

Modify user’s info

usermod -c "full name" username

Password change

passwd username

Password lock

passwd -l username

Password unlock

passwd -u username

Set password age for 90 days

chage -M 90 username

Set password never expire

chage -M -1 username

Set password to expire on specify date

chage -E 2012-01-01 username

Set warning 2 days prior to password expiration

chage -W 2 username

List password policy

chage -l username

Add a group

groupadd groupname

Add user to a group

usermod -G groupname username

Make the group assignment effective without logout

newgrp groupname

Change UID

usermod -u UID username

List user’s belong group

groups

Change group name

groupmod -n newname oldname

Change group ID

groupmod -g 1000 groupname

Show user’s ID

id username

Assign a user as group administrator

gpasswd -A username groupname

Assign a user to a group by adminstrator

gpasswd -a username groupname

Remove a group

groupdel groupname
Related Posts with Thumbnails