Mariam Questions Flashcards

1
Q

How do you verify that no graphical interface is in use?

A

Use the command ls /usr/bin/*session. If the output differs from the expected result, a graphical interface is in use.

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

How do you check if the UFW service is in use?

A

Run sudo ufw status and sudo service ufw status.

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

How do you check if the SSH service is in use?

A

Run sudo service ssh status.

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

How do you check if you are using the Debian or CentOS operating system?

A

Use the command uname -v or uname --kernel-version.

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

How do you check if your user is within the ‘sudo’ and ‘user42’ groups?

A

Run getent group sudo and getent group user42.

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

How do you create a new user that follows the password policy?

A

Use the command sudo adduser name_user and enter a password that follows the policy.

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

How do you create a new group named ‘evaluating’?

A

Run sudo addgroup evaluating.

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

How do you add a new user to the new group?

A

Use sudo adduser name_user evaluating and verify it has been added correctly.

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

How do you check if the machine’s hostname is correct?

A

Verify that the hostname is login42.

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

How do you modify the hostname to replace your login with the evaluator’s?

A

Edit /etc/hostname and /etc/hosts to replace your login with student42, then reboot the machine.

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

How do you check that all partitions are as indicated?

A

Run the command lsblk.

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

How do you check that sudo is installed?

A

Use which sudo and for better use, run dpkg -s sudo.

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

How do you add a new user to the sudo group?

A

Run sudo adduser name_user sudo and check that the user is within the group.

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

How do you show the application of the rules imposed for sudo?

A

Demonstrate the rules as specified.

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

How do you check that the path /var/log/sudo/ exists and contains at least one file?

A

Run a command with sudo and check that the file is updated.

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

How do you check that the UFW program is installed and working correctly?

A

Run dpkg -s ufw and sudo service ufw status.

17
Q

How do you list the active rules in UFW?

A

Run sudo ufw status numbered. If the bonus part is not done, only the rule for port 4242 should appear.

18
Q

How do you create a new rule for port 8080?

A

Run sudo ufw allow 8080 to create it, then verify with sudo ufw status numbered. To delete it, use sudo ufw delete num_rule.

19
Q

How do you check that the SSH service is installed and works correctly on port 4242?

A

Use which ssh and sudo service ssh status.

20
Q

How do you use SSH to log in with the newly created user?

A

Connect using ssh newuser@localhost -p 4242. Ensure that you cannot use SSH with the root user.

21
Q

How do you modify the runtime of the script from 10 minutes to 1?

A

Run sudo crontab -u root -e and change the first parameter from 10 to 1.

22
Q

How do you stop the script from running when the server has started?

A

Run sudo /etc/init.d/cron stop. To restart, use sudo /etc/init.d/cron start.

23
Q

How do you disable cron permanently?

A

Run sudo systemctl disable cron. After rebooting, cron will remain disabled.

24
Q

How do you restart cron after disabling it?

A

Use sudo systemctl enable cron and sudo systemctl start cron.