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