Linux Hardening Flashcards

Learning about Linux

1
Q

What is the Required permissions to copy or move files in Linux?

A

r-x in the source directory and r on the source file, wx in the target directory and w on the target file __IF__ it already exists.

You need read permission to copy files, x to jump into both directories.

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

What are the 3 main branches of linux distributions?

A

Slackware
Red hat
Debian

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

What is the file that stores a clients private ssh key?

A

id_rsa

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

What is the file that stores a clients public ssh key?

A

id_rsa.pub

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

Where does the server store public keys of trusted clients?

A

authorized_keys

Stored in users home directory on server: ~/.ssh/authorized_keys

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

What does a shell do?

A

Read, evaluate, print, loop

Awaits input, performs command, prints results, awaits input, performs..

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

What is bash short for?

A

Bourne again shell

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

What does the cd command do?

A

changes directory
“cd “ or “cd ~” returns to user home folder
“cd ..” jumps to the directory above current one
“cd ../..” jumps two steps up above current one
“cd -“ jumps to previous directory
“cd /home/username/folder” jumps to specified path

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

What does the chmod command do?

A

Changes permission for a directory or file

Changes the — — — permissions

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

Who can use the chown command?
And what does it do?

A

Root
Changes the owner of a directory or file

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

In what folder is the systems configuration files stored?

A

/etc/

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

What user id does root have?

A

0

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

What are the names of the three data streams and their coresponding number?

A

stdin - 0
stdout - 1
stderr - 2

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

What does it mean to have x permission on a directory and file?

A

On a directory x means you can change directory to it
On a file x means you can run scripts

The x permission is not visible on files.

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

In what two ways can you use chmod?

A

chmod 777 (binary)
chmod ugo+rwx (ugo+permisson)

r = 4, w = 2, x =1 in binary.
752 would correspond to rwx r-x -w-

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

What are special file permissions?

A

SUID - allows directory/file to be used as the owner
SGID - allows directory to be used as the owner group
Sticky bit - prevents deletion.

An “s” will replace “x” for user/group respectively

17
Q

How do you set SUID on a file?

A

chmod 4000
chmod u+s

4 is followed by the regular rwx binary

17
Q

How do you set GID on a file?

A

chmod 2000
chmod g+s

2 is followed by the regular rwx binary

18
Q

How do you set sticky on a directory?

A

chmod 1000
chmod o+t

1 is followed by the regular rwx binary

19
Q

How do you remove special file permissions?

A

chmod 00777
chmod ug-s
chmod o-t

00 is followed by the regular rwx binary

20
Q

What is the command to list attributes?

A

lsattr

a, c, i, j, m, A, C

https://wiki.archlinux.org/title/File_permissions_and_attributes#File_attributes

21
Q

What is the command to change attributes?

A

chattr +a
chattr -a

a, c, i, j, m, A, C

https://wiki.archlinux.org/title/File_permissions_and_attributes#File_attributes

22
Q
A
23
Q
A