Lesson 2: Managing Users and Groups Flashcards

1
Q

echo (command)

A

Repeats input back to the user on the screen.

***commonly used to send information to the user in a script.

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

ls (command)

A

Lists the contents of a directory. Can be given options to view permissions, hidden files, etc.

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

pwd (command)

A

Displays the current working directory you are in.

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

cd (command)

A

Changes your current working directory.

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

touch (command)

A

Updates timestamp on an existing file, but can also be used to create an empty file.

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

cp (command)

A

Copies a file or directory to another location.

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

mkdir (command)

A

Creates a directory.

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

cat (command)

A

is used to view the contents of a file without the option to edit that file.

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

less (command)

A

is used to view the contents of a file when those contents won’t fit entirely on one screen. breaks the content output into pages that you can scroll through at the CLI

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

vim

A

Starts a powerful text editorand the default for Linux.

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

nano (command)

A

Starts a simple, user-friendly text editor. It may not be installed on all distros.

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

gedit (command)

A

Starts a GUI text editor that is easy to use. Requires a desktop environment to be installed.

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

su (command)

A

“substitute user” switches user credentials

The syntax of the su command is su [-] [user name]

Note: Without a user name argument, the su - command will assume you mean to lesign in as root.

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

sudo (command)

A

Executes command as root

Password cached for five minutes by default

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

su - (command)

A

Switches to root

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

What command do we use to create a user account?

A

useradd

example: useradd jdoe

Or you can do something like useradd jdoe -c “John Doe” -e 2019/12/31 -s /bin/dash -d /home/john_doe

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

What three commands will allow you to modify a user?

A

You can you userdel, usermod, or chsh

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

Wsshat is the default password for the user?

A

There is no default password for user. One will have to be created using: passwd

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

How can you view user defaults?

A

useradd -D

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

What is the principle of least privilege?

A

users should be given no more authority on the system than they need to perform their job

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

What command permits a user to edit a file with their own credentials, even if the file is only available to root user?

A

sudo edit

The syntax of the sudo edit command is sudo edit [options] {file name} -> sudo edit /path/to/file

22
Q

What is the wheel group?

A

Distributions allow administrative functions based on membership in the wheel group.Members of the wheel group exercise the administrative privileges of root with less potential for damaging the system.

23
Q

Which file allow you to configure a user with superuser privileges and how do you get to that file?

A

Enter visudo to open the /etc/sudoers file

24
Q

Whalesst file can you view all of the following “User name, Password, User ID, Group ID, Comment, Home directory and Login shell”?

A

The /etc/passwd file

25
Q

What command is used to control password expiration, expiration warnings, inactive days, and other information for existing accounts?

A

chage

The syntax of the chage command is chage [options] {user name}

26
Q

What colsmmand creates a group?

A

groupadd

The syntax of the groupadd command is groupadd [options] {group names}

27
Q

What command is used to change group’s attributes?

A

groupmod

The syntax of the groupmod command is groupmod [options] {group names}

28
Q

What command will delete groups from the /etc/group file?

A

groupdel

The syntax of the groupdel command is groupdel [options] {group names}

29
Q

What does the whoami command used for?

A

Used to display the user name you are currently logged in to

30
Q

What does the # and $ characters represent?

A

For the root users it will show # & for standard users, the prompt will show a $ character

31
Q

What command determines the details of users currently logged in to a system?

A

The who command which includes the user name, the name of the system from which the user is connected, and the date and time that the user has been connected since.

The syntax of the who command is who [options]

32
Q

What command displays the history of user login and logout actions, along with the actual time and date?

A

last

The syntax of the last command is last [options]

33
Q

What command is used to display user ID (UID) and group ID (GID) information?

A

id

The syntax of the id command is id [options] [user name]

34
Q

What is the .bashrc file?

A

File that enables customization of the user’s own environment

35
Q

Where is the .bashrc file stored?

A

In a user’s home directory

36
Q

What file provides shell configuration for the initial login environment?

A

The .bash_profile file

note: the .bash_profile file is only read with the first login, while the .bashrc is read with all subsequent logins

37
Q

What is the w command primarily used for?

A

To display the details of users who are currently logged in to a system and their transactions.

The syntax of the w command is w [options] [user name]

38
Q

What command displays the following information in order 1. status of the system, 2. table with the first column listing the users logged in to the system and lastly 3. indicating the current activities of the users?

A

The w command

39
Q

What file is delegation done in?

A

/etc/sudoers file

can be done using the visudo editor

40
Q

What does each set of number represent in”17960:0:99999:7” & what is this a good indication of?

A

This is a good indication that a password has not been set for a user.

17960 = date password was stored (epoch format): 0 = minimum age: 99999 = maximum age: 7 = warning interval (days ahead of exp date you’ll get a warning)

41
Q

What is /etc/skel ?

A

A directory are automatically copied into the home
directories of new users.

  • The contents of the /etc/skel directory are automatically copied into the home directories of new users. The account’s home directory is populated using files from the /etc/skeldirectory.
42
Q

How would you maintain /etc/skel/ directories for new user accounts?

A
  1. Assume superuser privileges
  2. Enter cd /etc/skel
  3. Enter vim .bash_profile
  4. Make the necessary changes
43
Q

What is the /etc/passwd ?

A

A file that stores user all account information, default or user-specific.

44
Q

What is /etc/group ?

A

Is the storage location for groups. All groups, default or user-specific, will be found in this file.

45
Q

What are some commands to edit the /etc/group file?

A

The proper way to edit the /etc/group file is with the groupadd, groupmod,and groupdel commands.

46
Q

What is /etc/shadow?

A

This is a modern storage location for hashed passwords, as well as additional account information (stores details about User name, Password, Days since password changed, Days before password must be changed, Days until user is warned to change password, Days after password expires that account is disabled, Days the account has been disabled, Unused)

note: only root has access to the content of the /etc/shadow file.

47
Q

What is /etc/profile ?

A

The /etc/profile file provides system-wide environment variables. This may be more effective for administrators to configure if there are settings that apply to all users.

48
Q

What is gpasswd -a command and option?

A

allow you to add user to group

49
Q

What is gpasswd -d command and option?

A

allow your to remove user from group

50
Q

What is gpasswd -A command and option?

A

allows you to add user as an admin of the group