Enhance your CompTIA CASP+ exam readiness with our comprehensive quizzes. Sharpen your skills with detailed flashcards and multiple choice questions, each with hints and in-depth explanations. Prepare effectively for this challenging exam!

Practice this question and more.


What measure should be taken in the Linux server to prevent attack exploitation?

  1. Change file permissions

  2. Mount tmp directories with nosuid, noexec

  3. Delete the tmp files

  4. Update the OS

The correct answer is: Mount tmp directories with nosuid, noexec

Mounting temporary directories with the "nosuid" and "noexec" options is an effective security measure to prevent attack exploitation on a Linux server. When the "nosuid" option is applied, it disables the execution of set-user-identifier (setuid) bits on files within the mounted file system. This means that even if an attacker is able to place a malicious executable in a temporary directory, it will not run with elevated privileges, thereby limiting the potential impact of the attack. The "noexec" option prevents the execution of any binary files within the mounted directory, which further mitigates the risk by ensuring that even if a malicious file is present, it cannot be executed. While other measures like changing file permissions, deleting temporary files, or updating the OS can indeed improve the overall security posture of a Linux server, they do not specifically target the risks associated with executing potentially malicious files in temporary directories the way that mounting with "nosuid" and "noexec" does. Each of these options has its own merits, but they do not provide the same level of protective measures against exploitation in the context of temporary directories.