User and Group Management Flashcards
cat useradd
Create a new user or update default new user information
- change default home directory
-update users default group
- set expiration date for disablement
groupadd
create a new group
- set group ID different then default one upon creation
-specify group as a system group
usermod
modify a user account
-change users group membership
-change user ID
-update group membership
groupmpod
modify a group definition on the system
-update group ID and name of group
userdel
delet a user account and related files
-r remove files in home directory
groupdel
delete a group
-you cannot remove a group that is a primary group for an existing user, first user must be deleted
passwd
change users password. The super user can change password for any user
- to change your own password type passwd
-to change another users password as a root or superuser type passwd and user name
How do you see a group ID?
cat /etc/group and scroll down to the group you created
What is the command to update a groupID and add a new group
groupadd -g 1200 ops
What is the command to see the ID for a user?
ID clark or whatever username they have
How do you create a new user without a default home directory but instead assign it to a new group you create?
useradd -M -g ops barry (-M will not create a home directory for the user) (-g will create a group)
Command to see list of users
cat /etc/passwd
ll /home/
usermod -G dev, ops -u 1300 clark
this updates clarks groups to dev and ops and their id
groupmod - n dev2 dev
This command modifies the name of dev using -n option and changes it to dev2 to see this change do id clark and notice the group name he is assigned to is no longer dev the ID doesnt change
Chane home directory for a user
usermod -d /home/flash barry
How do you switch to a user?
su - barry