Lesson 5 Flashcards

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
Q

which command to list a users information?

A

id username

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

lists the groups that a user is part of

A

groups username

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

how do delete a user?

A

userdel -r username

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

what is the /etc/skel directory?

A

contains the skeleton structure files and directories to create for a users home directory when created

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

how to add a new group

A

groupadd groupname

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

how to delete a group

A

groupdel groupname

31
Q

how to lock a user account?

A

passwd -l username

32
Q

which file does this entry belong to?

developer:x:1010:frank,grace,dave

A

/etc/group

33
Q

which file does this entry belong to?

root:x:0:0:root:/root:/bin/bash

A

/etc/passwd

34
Q

which file does this entry belong to?

henry:$1$.AbCdEfGh123456789A1b2C3d4.:18015:20:90:5:30::

A

/etc/shadow

35
Q

which file does this entry belong to?

henry:x:1000:1000:User Henry:/home/henry:/bin/bash

A

/etc/passwd

36
Q

which file does this entry belong to?

staff:!:dave:carol,emma

A

/etc/gshadow

37
Q

web_developer:!:kevin:grace,kevin,christian

who is the administrator of this group?

A

Kevin

38
Q

Where you can you see a users password expiration?

A

in /etc/shadow in the third group

39
Q

Where can you see when a users password expires?

A

Second to last field in /etc/shadow

40
Q

Using symbolic mode, what are the symbols to add, remove or set a specific value?

A

+, -, =

41
Q

If you want to grant write permission to a file for members of a group what would the command be (symbolic mode)

A

chmod g+w file.type

42
Q

If you want to remove read permissions of a user from a file in symbolic mode?

A

chmod u-r filename

43
Q

In symbolic mode, set rw permissions for all on a file

A

chmod a=rw- filename

44
Q

In symbolic mode how can you edit permissions for file and group at the same time?

A

chmod u+rwx,g-x filename

45
Q

how can you modify permissions recursively?

A

chomd -R u+rwx directoryname/

46
Q

In numeric mode how could use set user and group to read write?

A

chomd 660 file

47
Q

In numeric mode describe the octet values

A

Read = 4
Write = 2
Execute = 1

So r/w would be 6 for each group

48
Q

When is symbolic mode better than numeric mode?

A

When you want to just change one specific permission without having to correctly write the others ex:

chmod u+x filename

49
Q

what is chown?

A

Used to modify the ownership of a file or directory

50
Q

What is the chown syntax?

A

chown username:groupname filename

51
Q

Use chown to change ownership of a file to jane

A

chown jane filename

52
Q

how to query groups on your system with a command

A

groups

53
Q

command to show members of a group

A

groupmems

54
Q

What does the sticky bit do?

A

Applies only to directories and prevents users from removing or renaming a file in a directory unless they own that file or directory

55
Q

what does chgrp do?

A

changes the owning group of a file

56
Q

what does ls -ld do?

A

Lists the attributes of a directory instead of listing its contents

57
Q

What is the GID flag

A

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
Q

what kind of file is this?

brw-rw—- 1 root disk 8, 17 Dec 21 18:51 /dev/sdb1

A

a block device as annotated by the “b”

59
Q

What are temporary files?

A

Files used by programs to store data that is only needed for a short period of time

60
Q

Where are temp files normally stored?

A

/tmp
/var/temp
/run

61
Q

What does the sticky bit do?

A

it prevents users from removing or renaming a
file within that directory unless they own the file

62
Q

What problem does the sticky bit solve?

A

For global areas like /tmp, it allows the prevention of users from deleting files that they do not own

63
Q

what does SUID do?

A

Applies to executables and enables the file to run with the permissions of the owner and not the person executing it

64
Q

What does SGID do?

A

Allows a file to be executed with the privileges of the group and not the user executing it

65
Q

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?

A

ln target.txt /home/carol/Documents/hardlink

66
Q

how do you create a symbolic link named softlink in /home/carol/Documents/ pointing to a file target.txt in the current directory?

A

ln -s target.txt /home/carol/Documents/softlink

67
Q

what’s the difference between a hard link and a symbolic (soft) link?

A

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
Q

what is the chmod symbolic mode parameter to enable the sticky bit on a directory?

A

chmod +t <directory></directory>

69
Q

if you create a symbolic link without specifying the full path to the target, what might happen if you move the link?

A

the link might break because the system interprets the target’s location as relative to the link’s location.

70
Q

which temporary directory must be cleared during the boot process?

A

/tmp

71
Q

explain the difference between a hard link to a file and a copy of this file.

A

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
Q

what is an inode?

A

a data structure that stores attributes about the file including it’s memory location etc

73
Q
A