Administrative Tasks Flashcards
Format of /etc/passwd entry
username:password:UID:Primary GUID:comment:homedir:default shell
User IDs under _____ are reserved for system users
100
What can you change the shell section of an /etc/passwd entry to that will cause the user to not be able to login?
/bin/false
Normal user accounts have IDs from ___ to ____
500 to 1000
What should permissions be on /etc/passwd
644
What should permissions be on /etc/shadow
600
pwck
Verifies the integrity of the users and authentication information by checking /etc/passwd and /etc/shadow
useradd -c
usually used to set user’s full name
useradd -d
Used to set the user’s home directory
useradd -e
Set the user’s expiration date in the form YYYY-MM-DD
useradd -p
Set your own encrypted password
useradd -M
Do not create the home directory
useradd -m
Create the home directory /home/username if it does not exist
useradd -G
Defines all the other groups that the member belongs to. Separate each group by a comma .
useradd -g
Sets the default group that is the users group when the user first logs in
useradd -f INACTIVE
defines the number of days after a password expires that an account is permanently disabled. Value of 0 disables immediately after the password expires and -1 disables the entire inactive feature.
useradd -k skel_dir
Use skel_dir as the skeleton directory instead of /etc/skel
Location for default settings for the useradd command
/etc/default/useradd
chage
Used to change and manage users’ expiry dates
chage -E
set the date that the user’s password will expire
chage -I
Set the number of days of inactivity after a password expired before locking the account
chage -m
Set minimum number of days between password changes
chage -M
Set maximum number of days which a password is valid
groupdel
Used to delete a group (cannot do this if any user has the group as their primary group)
groupmod -g
Specify a new group id
groupmod -o
When used with -g it allows two groups to share the same group id