Mariam Questions Flashcards
How do you verify that no graphical interface is in use?
Use the command ls /usr/bin/*session
. If the output differs from the expected result, a graphical interface is in use.
How do you check if the UFW service is in use?
Run sudo ufw status
and sudo service ufw status
.
How do you check if the SSH service is in use?
Run sudo service ssh status
.
How do you check if you are using the Debian or CentOS operating system?
Use the command uname -v
or uname --kernel-version
.
How do you check if your user is within the ‘sudo’ and ‘user42’ groups?
Run getent group sudo
and getent group user42
.
How do you create a new user that follows the password policy?
Use the command sudo adduser name_user
and enter a password that follows the policy.
How do you create a new group named ‘evaluating’?
Run sudo addgroup evaluating
.
How do you add a new user to the new group?
Use sudo adduser name_user evaluating
and verify it has been added correctly.
How do you check if the machine’s hostname is correct?
Verify that the hostname is login42
.
How do you modify the hostname to replace your login with the evaluator’s?
Edit /etc/hostname
and /etc/hosts
to replace your login with student42
, then reboot the machine.
How do you check that all partitions are as indicated?
Run the command lsblk
.
How do you check that sudo is installed?
Use which sudo
and for better use, run dpkg -s sudo
.
How do you add a new user to the sudo group?
Run sudo adduser name_user sudo
and check that the user is within the group.
How do you show the application of the rules imposed for sudo?
Demonstrate the rules as specified.
How do you check that the path /var/log/sudo/ exists and contains at least one file?
Run a command with sudo and check that the file is updated.
How do you check that the UFW program is installed and working correctly?
Run dpkg -s ufw
and sudo service ufw status
.
How do you list the active rules in UFW?
Run sudo ufw status numbered
. If the bonus part is not done, only the rule for port 4242 should appear.
How do you create a new rule for port 8080?
Run sudo ufw allow 8080
to create it, then verify with sudo ufw status numbered
. To delete it, use sudo ufw delete num_rule
.
How do you check that the SSH service is installed and works correctly on port 4242?
Use which ssh
and sudo service ssh status
.
How do you use SSH to log in with the newly created user?
Connect using ssh newuser@localhost -p 4242
. Ensure that you cannot use SSH with the root user.
How do you modify the runtime of the script from 10 minutes to 1?
Run sudo crontab -u root -e
and change the first parameter from 10 to 1.
How do you stop the script from running when the server has started?
Run sudo /etc/init.d/cron stop
. To restart, use sudo /etc/init.d/cron start
.
How do you disable cron permanently?
Run sudo systemctl disable cron
. After rebooting, cron will remain disabled.
How do you restart cron after disabling it?
Use sudo systemctl enable cron
and sudo systemctl start cron
.