LPI Part 2 Flashcards
/etc/group
A text file which defines the groups to which users belong
GID
Group ID
Each user must be assigned a group ID. You can see this number in your /etc/passwd file
id
Used to find out user and group names and numeric ID’s (UID or group ID) of the current user or any other user in the server
id information
-User name and real user id.
-Find out the specific Users UID.
-Show the UID and all groups associated with a user.
-List out all the groups a user belongs to.
-Display security context of the current user.
last
Displays information about the last logged-in users.
Takes the system log file /var/log/wtmp as the data source to generate reports.
who
Displays information about currently logged-in users.
-Time of last system boot
-Current run level of the system
-List of logged-in users and more.
w
Displays important information about who is currently using the computer, how much the computer is being used, and what programs are running.
Syntax: w [options] user […]
/etc/skel
A directory that contains files and directories that are automatically copied over to a new user’s when it is created from useradd command.
useradd
Used to add user accounts to your system.
Syntax: useradd [options] [user_name]
useradd -u
Creates a new user with a custom UID
useradd -g
Creates a new user and assigns a specific group ID
useradd -M
Creates a new user without a home directory
groupadd
Used to create groups.
Syntax: groupadd [options] group_name
groupadd -f
Forces the command to abort silently if the group with the given name already assists
groupadd -g
This option assigns a specific numeric group id to the newly created group
groupadd -r
Creates a system group
passwd
Modifies user passwords
Syntax: passwd [options] [username]
passwd -d
Deletes the user password, making the account password-less.
passwd -e
Immediately expires the account password, prompting the user to change it on the next login.
passwd -i
Sets the number of days after password expiration before the account is deactivated.
chmod
Used to change the access mode of a file.
Syntax: chmod [options] [mode] [File_name]
chmod -R
Apply the permission change recursively to all the files and directories within the specified directory.
chmod -v
It will display a message for each file that is processed. while indicating the permission change that was made.
chmod Operators
+ Add permissions
- Remove Permissions
= Set the permissions to the specified values