Linux Flashcards

(32 cards)

1
Q

Where would you find user account information?

File Location

A

/etc/passwd

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Where would you find account password hashes?

File Location

A

/etc/shadow

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

pwck

Command

A

Verifies each line in the /etc/passwd and /etc/shadow files and identifies discrepencies.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

pwconv

Command

A

Adds the necessary information to synchronize the /etc/passwd and /etc/shadow files.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Where would you find group information?

File Location

A

/etc/group

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Where would you find the default values used by the useradd command?

A

/etc/default/useradd

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

/etc/login.defs

Reminder

A

The /etc/login.defs file contains:
- Values used for the group and user ID numbers.
- Parameters for password encryption in the shadow file.
- Password expiration values for user accounts.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

/etc/skel

Reminder

A

The /etc/skel directory contains a set of configuration file templates that are copied into a new user’s home directory when it is created, including the following files:
- .bashrc
- .bash_logout
- .bash_profile
- .kshrc

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

useradd

Command

A

Adds a new user.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

useradd -c

Option

A

Adds a description for the account in the GECOS field.

This changes the full name of the account.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

useradd - m

Option

A

Creates the user’s home directory (if it does not exist)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

useradd

Option List

A
  • -c adds a description for the account in the GECOS field of /etc/passwd.
  • -d assigns an absolute pathname to a custom home directory location.
  • -D displays the default values specified in the /etc/default/useradd file.
  • -e specifies the date on which the user account will be disabled.
  • -f specifies the number of days after a password expires until the account is permanently disabled.
  • -M defines the secondary group membership.
  • -m creates the user’s home directory (if it does not exist).
  • -n does not create a group with the same name as the user (Red Hat and Fedora, respectively).
  • -p defines the encrypted password.
  • -r specifies that the user account is a system user.
  • -s defines the default shell.
  • -u assigns the user a custom UID. This is useful when assigning ownership of files and directories to a different user.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

passwd

Command

A

Assigns or changes a password for a user.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

passwd

Option List

A
  • -S username displays the status of the user account. LK indicates that the user account is locked, and PS indicates the user account has a password.
  • -l disables (locks) an account. This command inserts a !! before the password in the /etc/shadow file, effectively disabling the account.
  • -u enables (unlocks) an account.
  • -d removes the password from an account.
  • -n sets the minimum days before a password can be changed.
  • -x sets the number of days before a user must change the password (password expiration time).
  • -w sets the number of days before the password expires that the user is warned.
  • -t sets the number of days following the password expiration that the account will be disabled.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

usermod

Command

A

Modifies an existing user account.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

usermod

Option List

A
  • -c changes the description for the account.
  • -l renames a user account.
  • -L locks the user account. This command inserts a ! before the password in the /etc/shadow file, effectively disabling the account.
  • -U unlocks the user account.
17
Q

userdel

Command

A

Removes a user account.

18
Q

userdel -r

Option

A

Removes the user’s home directory.

19
Q

userdel

Option List

A
  • userdel [username] (without options) removes the user account.
  • -r removes the user’s home directory.
  • -f forces removing the user account even when the user is logged into the system.
20
Q

chage

Command

A

Sets user passwords to expire.

21
Q

chage

Option List

A
  • -M sets the maximum number of days before the password expires.
  • -W sets the number of days before the password expires that a warning message displays.
  • -m sets the minimum number of days that must pass after a password has been changed before a user can change the password again.
22
Q

ulimit

Command

A

Limits computer resources used for applications launched from the shell. Limits can be hard or soft. Users can modify soft limits, but only the root user can modify hard limits.

23
Q

ulimit

Option List

A
  • -c limits the size of a core dump file. The value is in blocks.
  • -f limits the file size of files created using the shell session. The value is in blocks.
  • -n limits the maximum number of files that can be opened.
  • -t limits the amount of CPU time a process can use. This is set in seconds.
  • -u limits the number of concurrent processes a user can run.
  • -d limits the maximum amount of memory a process can use. The value is in kilobytes.
  • -H sets a hard resource limit.
  • -S sets a soft resource limit.
  • -a displays current limits. The default shows soft limits.
24
Q

groupadd

Command

A

Creates a new group.

25
groupadd | Option List
The following options override the settings found in the /etc/login.defs file: - g defines the group ID (GID). - p defines the group password. - - r creates a system group.
26
groupmod | Command
Modifies the existing group.
27
groupdel | Command
Modifies the system account files by deleting all entries that refer to the specified group. The named group must exist. You cannot remove the primary group of any existing user. You must remove the user before you remove the group.
28
gpasswd | Command
Changes a group password.
29
gpasswd | Option List
- groupname prompts for a new password. - - r removes a group password.
30
newgrp | Command
Is used to change the current group ID during a login session. If the optional - flag is given, the user's environment will be reinitialized as though the user had logged in. Otherwise, the current environment, including the working directory, remains unchanged. You can use this when working in a directory where all the files must have the same group ownership.
31
usermod | Group Option List
Modifies group membership for the user account. Be aware of the following options: - g assigns a user to a primary group. - G assigns a user to a secondary group (or groups). Follow the command with a comma-separated list of groups. - aG assigns a user to a secondary group (or groups) by appending the group to any group the user already belongs to. Follow the command with a comma-separated list of groups. - - G "" removes the user from all secondary group memberships. Do not include a space between the quotes.
32
groups | Command
Display the primary and secondary group membership for the specified user account.