ch3. Users And Groups Flashcards
usermod
usermod -l
usermod -c
Bash command to change a user account
-l change username
-c change comment field
passwd -l
passwd -u
Bash command
-l lock an account
-u unlock an account
userdel
userdel -r
Bash command to delete a user account. Without options, does not delete the home directory, or saved files.
-r deletes the account including the home directory and saved files
/etc/group
stores all group information
group fields
Group Name : Password : Group ID : Group List (list of members)
groupadd
groupadd -g
.
groupadd -f
groupadd -o
groupadd -g
groupadd -n
Bash command to create a group (by default, no password, no members)
-g create group with name or ID
.
-f exit command with a success status if the group already exists
-o create a group with a non-unique group ID
-g change the ID of an existing group
-n change the name of an existing group
groupdel
Bash command to delete a group, but does not delete members of the group
usermod -a -G
Bash command to add a user to a group
whoami
Bash command to display current username of currently logged-in account
who
who -u
Bash command to print the details of of a user currently logged into a system, including: username, system name, and length of connection
-u prints user and idle time
standard user prompt
$
root user prompt
#
w (command)
Bash command to print the status of the system + users logged in, + current activities of users
last
Bash command to print information about connect times of users
useful for finding what commands were recently run
Where does ‘last’ retrieve info from?
/var/log/wtmp
.bashrc
file that allows customization of user’s own environment. In particular, enables command line alias that will only affect the .bashrc file’s user. Also creates an environment variable, set default directories, and file permissions for the default user. Also determines the default command prompt.
.bash_profile
shell config for initial login environment. (only used for very first login.) Think of as a default config for new users.