Lesson 5 Flashcards

(73 cards)

1
Q

How are users and groups indentified?

A

UIDs and GIDs

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

What is the length of modern UIDs?

A

64 bits

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

Every user has a UID and a GID

A

True

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

What is the UID of root?

A

0

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

What unique characteristics do user account shave?

A

UID starting with 1000
A defined home directory
A defined login shell

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

Name attributes of system accounts?

A

UID under 100 or 500-999
No home directory
No shell defined

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

What is the primary difference between system and service accounts?

A

Not a huge difference but their UID/GID/s will be different, service account >1000

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

What is the command to change the shell?

A

chsh

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

What does the id command do?

A

Lists basic information about the current shell user

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

what do the “who” and “w” commands do?

A

they list active logins to the system

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

What’s the biggest issue with using su to switch to root?

A

If a regular user’s session is compromised, the root password could be captured

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

Name the main configuration file locations for user accounts and access controls

A

/etc/passwd
/etc/group
/etc/shadow (passwords)
/etc/gshadow

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

what does the /etc/sudoers file contain?

A

users who can use the sudo command

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

What is the /etc/passwd file?

A

commonly referred to as the “password file”. each line contains multiple fields always delimited by a colon

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

What is the GECOS field?

A

contains three or more fields delimited by a comma, normally NAME, LOCATION,CONTACT

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

What does the chfn command do?

A

Changes information int he GECOS field

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

what does /etc/group store?

A

colon delimited information about groups

NAME:PASSWORD:GID:MEMBERS

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

In which files are UID and GID stored?

A

/etc/passwd

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

In which file are Groups stored?

A

/etc/group

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

In which file are passwords stored?

A

/etc/shadow

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

How are passwords stored?

A

With a one way hash

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

Which command to get all active logins on the system?

A

W command

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

command to add a user?

A

useradd username

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

command to set a users password?

A

passwd username

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
which command to list a users information?
id username
26
lists the groups that a user is part of
groups username
27
how do delete a user?
userdel -r username
28
what is the /etc/skel directory?
contains the skeleton structure files and directories to create for a users home directory when created
29
how to add a new group
groupadd groupname
30
how to delete a group
groupdel groupname
31
how to lock a user account?
passwd -l username
32
which file does this entry belong to? developer:x:1010:frank,grace,dave
/etc/group
33
which file does this entry belong to? root:x:0:0:root:/root:/bin/bash
/etc/passwd
34
which file does this entry belong to? henry:$1$.AbCdEfGh123456789A1b2C3d4.:18015:20:90:5:30::
/etc/shadow
35
which file does this entry belong to? henry:x:1000:1000:User Henry:/home/henry:/bin/bash
/etc/passwd
36
which file does this entry belong to? staff:!:dave:carol,emma
/etc/gshadow
37
web_developer:!:kevin:grace,kevin,christian who is the administrator of this group?
Kevin
38
Where you can you see a users password expiration?
in /etc/shadow in the third group
39
Where can you see when a users password expires?
Second to last field in /etc/shadow
40
Using symbolic mode, what are the symbols to add, remove or set a specific value?
+, -, =
41
If you want to grant write permission to a file for members of a group what would the command be (symbolic mode)
chmod g+w file.type
42
If you want to remove read permissions of a user from a file in symbolic mode?
chmod u-r filename
43
In symbolic mode, set rw permissions for all on a file
chmod a=rw- filename
44
In symbolic mode how can you edit permissions for file and group at the same time?
chmod u+rwx,g-x filename
45
how can you modify permissions recursively?
chomd -R u+rwx directoryname/
46
In numeric mode how could use set user and group to read write?
chomd 660 file
47
In numeric mode describe the octet values
Read = 4 Write = 2 Execute = 1 So r/w would be 6 for each group
48
When is symbolic mode better than numeric mode?
When you want to just change one specific permission without having to correctly write the others ex: chmod u+x filename
49
what is chown?
Used to modify the ownership of a file or directory
50
What is the chown syntax?
chown username:groupname filename
51
Use chown to change ownership of a file to jane
chown jane filename
52
how to query groups on your system with a command
groups
53
command to show members of a group
groupmems
54
What does the sticky bit do?
Applies only to directories and prevents users from removing or renaming a file in a directory unless they own that file or directory
55
what does chgrp do?
changes the owning group of a file
56
what does ls -ld do?
Lists the attributes of a directory instead of listing its contents
57
What is the GID flag
Sets Group ID Bit, octal value of 2. Can be applied to executable files or directories. On an executable it will make the process executing it inherit the privileges of the group who owns the file
58
what kind of file is this? brw-rw---- 1 root disk 8, 17 Dec 21 18:51 /dev/sdb1
a block device as annotated by the "b"
59
What are temporary files?
Files used by programs to store data that is only needed for a short period of time
60
Where are temp files normally stored?
/tmp /var/temp /run
61
What does the sticky bit do?
it prevents users from removing or renaming a file within that directory unless they own the file
62
What problem does the sticky bit solve?
For global areas like /tmp, it allows the prevention of users from deleting files that they do not own
63
what does SUID do?
Applies to executables and enables the file to run with the permissions of the owner and not the person executing it
64
What does SGID do?
Allows a file to be executed with the privileges of the group and not the user executing it
65
what command would you use to create a hard link named hardlink in the directory /home/carol/Documents/ to a file named target.txt in the current directory?
ln target.txt /home/carol/Documents/hardlink
66
how do you create a symbolic link named softlink in /home/carol/Documents/ pointing to a file target.txt in the current directory?
ln -s target.txt /home/carol/Documents/softlink
67
what's the difference between a hard link and a symbolic (soft) link?
a hard link is another name for the same file (points to the same inode), while a symbolic link is a pointer to the path of the original file.
68
what is the chmod symbolic mode parameter to enable the sticky bit on a directory?
chmod +t
69
if you create a symbolic link without specifying the full path to the target, what might happen if you move the link?
the link might break because the system interprets the target's location as relative to the link's location.
70
which temporary directory must be cleared during the boot process?
/tmp
71
explain the difference between a hard link to a file and a copy of this file.
a hard link points to the same inode as the original file, so changes to one affect the other. a copy is a separate file with its own inode, so changes to one do not affect the other.
72
what is an inode?
a data structure that stores attributes about the file including it's memory location etc
73