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
groupmod -n
Specify a new group name
userdel -f
Force the deletion of the user even if they are logged in.
Will also delete home directory and mail
userdel -r
Will remove the home directory and mail.
Note: does not remove all other files owned by the user outside of their home directory
usermod -d
Set the user’s home directory
usermod -e
Set the date on which the account will expire
usermod -f
Number of days after a password expires until account is permanently disabled
usermod -g
default login group
usermod -G
List of extra groups a user is part of
usermod -l
Change the login name of the user
usermod -L
Lock the account
/etc/group
File containing list of groups and all the members associated with the group
groupadd -g
Specify a group id
groupadd -r
Chooses a group id less than 500 used for system groups
groupadd -f
Forces group creation even if there is already a group by that name
passwd -x
Specify number of days a password must remain valid
passwd -n
Minimum number of days between password changes
passwd -i
Make account inactive after password has been expired for some number of days
echo $$
Display current shell process
echo $?
Display exit value of the last command
echo $!
Display the PID of the last job run in background
echo $0
Display the name of the shell or script
Location that crontabs are stored for users
/var/spool/cron/*
atq
List pending AT jobs
File in which you list users that you want to deny use of at
/etc/at.deny
File in which you list users that you want to specifically allow use of at
/etc/at.allow
File in which you list users that you want to deny use of cron
/etc/cron.deny
File in which you list users that you want to allow use of cron
/etc/cron.allow
atrm jobnum
Will remove the at task with the specified jobnum
at
Program that causes commands specified to be executed once at a specified later time.
End things with ctrl + d
at now + 1 minute
Will perform the specified commands 1 minute from now
Cron Format
minute hour day month day-of-week command
What do locale settings determine?
Language, country, currency symbols, etc.
Language environment variable
LANG
Are timezone settings part of locale settings?
no!
Location of the time zone file
/etc/timezone
How to set the correct timezone?
ln –s some timezone file from /usr/share/zoneinfo to /etc/timezone or copy the
correct zone file from /usr/share/zoneinfo and replace /etc/timezone
tzconfig
GUI tool to help make time zone changes
iconv
Utility used to convert between character sets
Unicode
Character set designed to support as many languages as possible