A systems administrator has been tasked with disabling the nginx service from the environment to prevent it from being automatically and manually started. Which of the following commands will accomplish this task?
Answer B (systemctl disable nginx) and answer C (systemctl mask nginx) both achieve the goal of disabling the nginx service, but they do it in different ways.
The systemctl disable nginx command disables the nginx service so that it will not start automatically when the system boots up. However, the service can still be manually started if needed.
The systemctl mask nginx command masks the nginx service, which means that it cannot be started, either automatically or manually. This is a more secure option compared to systemctl disable nginx, as it completely prevents the service from being started.
In this scenario, either answer B or answer C would be correct, depending on the level of security that the systems administrator wants to enforce. If the administrator wants to prevent the nginx service from starting in any circumstance, then answer C (systemctl mask nginx) is the better choice. If the administrator wants to prevent the nginx service from starting automatically but still allow it to be manually started if needed, then answer B (systemctl disable nginx) is the better choice.
https://askubuntu.com/questions/816285/what-is-the-difference-between-systemctl-mask-and-systemctl-disable
Disabling the service deletes the symlink, so the unit file itself is not affected, but the service is not loaded at the next boot, when systemd reads /etc/systemd/system.
However, a disabled service can be loaded, and will be started if a service that depends on it is started; enable and disable only configure auto-start behaviour for units, and the state is easily overridden.
A masked service is one whose unit file is a symlink to /dev/null. This makes it "impossible" to load the service, even if it is required by another, enabled service.
When you mask a service, a symlink is created from /etc/systemd/system to /dev/null, leaving the original unit file elsewhere untouched. When you unmask a service the symlink is deleted.
The correct command to disable the nginx service from being automatically and manually started is "systemctl disable nginx". The command "systemctl disable" will disable the service, which means that it will not start automatically during boot and will not be able to be started manually.
The "systemctl stop nginx" command will only stop the service if it is currently running, but will not prevent it from being started again in the future.
The "systemctl cancel nginx" and "systemctl mask nginx" commands are not commonly used and will not accomplish the task of disabling the nginx service.
hello,
please, read the question again, you may not be understanding what they are asking, Comptia wording is brutal so be careful.You can manually start a disabled service with the systemctl start command after the system boots, to prevent this, you must use the mask subcommand, masking the service links its configuration to /dev/null.
A user or process will not be able to start this service at all (whereas with a disabled service, a user or process can still start it). Use the unmask subcommand to reverse the setting:
Ex: $ sudo systemctl mask sshd
enable/disable just says what should happen at boot. it will not step a user or service from manually executing like mask will
upvoted 1 times
...
...
This section is not available anymore. Please use the main Exam Page.XK0-005 Exam Questions
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
linux_admin
Highly Voted 1 year, 2 months agoBryanSME
Most Recent 5 months, 3 weeks agoAlizadeh
8 months, 3 weeks agoBreakOff874
1 year, 1 month agoKnifeClown1
1 year, 2 months agoKnifeClown1
1 year, 2 months agoNotnotataco
1 year, 5 months agoVeteran903
1 year, 5 months agoNotnotataco
1 year, 5 months agoTheRealManish
1 year, 5 months ago