An organization's business office needs to collaborate on quarterly reports and asks the systems administrator to create a finance group. The administrator creates the following directory: drwxrwxr-x Business Business |j096 Oct 15 16:40 Q1
Which of the following commands will allow all members of the finance group to have group ownership of all files created in the Q1 directory while ensuring that members of the business group preserve access? (Select two).
Answer : A, D
To ensure all files created in Q1 inherit the group ownership of finance, the chmod g+s command sets the group ID (SGID) on the directory, ensuring new files belong to the group of the directory. chown Finance Q1/ changes the group ownership of Q1 to Finance, allowing Finance group members access. These settings facilitate collaborative permissions as per CompTIA Linux+ recommendations for group-based file sharing. Reference: CompTIA Linux+ Study Guide.
A DevOps engineer wants to work on a snapshot of the infrastructure as code configuration. Which of the following commands should the engineer use to accomplish this task?
Answer : D
Creating a snapshot of the current state of the code in Git is best achieved with the git tag <feature> command, which is often used to mark release points or stable versions in a project. Tags are helpful for referencing points in history without affecting the branch structure. Unlike branches, which are for active development, tags are commonly used to mark versions for future reference or deployment. Reference: CompTIA Linux+ Study Guide.
A systems administrator is receiving complaints about slow performance and system crashes. The administrator suspects memory and CPU issues. Which of the following is the first action the administrator should take to troubleshoot and resolve these issues?
Answer : A
The initial troubleshooting step when experiencing slow performance and potential memory or CPU issues is to analyze the current resource usage. Running tools like top or htop allows the administrator to observe real-time data on CPU, memory, and processes, providing insights into high resource usage. This is a non-invasive first step, helping to identify whether issues are due to overuse, application memory leaks, or specific processes. CompTIA Linux+ recommends understanding system resource behavior before taking further action. Reference: CompTIA Linux+ Study Guide.
A Linux systems administrator needs to compress a file named passwords.txt. The compressed file should be saved as passwords.txt.gz. Which of the following commands should the administrator use to accomplish this task?
Answer : A
The gzip command with the -c flag outputs the compressed data to standard output, which can then be redirected to create a .gz file. This approach maintains the original file while creating a compressed version.
A Linux administrator is investigating the reason a systemd timer is not running every night at midnight. The administrator sees the following unit file:
[Unit]
Description=Execute backup every day at midnight
[Timer]
OnCalendar=--01 00:00:00
Unit=backup.service
RandomizedDelaySec=10800
[Install]
WantedBy=multi-user.target
Which of the following modifications should the administrator make in the unit file? (Select two).
Answer : A
The RandomizedDelaySec parameter delays the timer by a random time within the specified seconds, which can be up to 3 hours in this case. Removing it will ensure the timer triggers at exactly midnight. Additionally, using OnCalendar=--* daily correctly schedules the timer to run every day at midnight.
An administrator wants to execute a long-running script in the terminal while troubleshooting another issue. Which of the following options will achieve this goal?
Answer : A
Running a command with & at the end sends it to the background, allowing the administrator to continue using the terminal for other tasks while the script runs. This is useful for long-running scripts that do not require immediate attention but need to keep running.
An administrator changed the default port of an SSH server to 2222 on myhost, and clients are not able to connect. The administrator runs some commands and receives the following output:
vbnet
Copy code
$ ssh -p 2222 myhost
ssh:connect to host myhost on port 2222: No route to host
Which of the following commands should be run on myhost?
Answer : B
The administrator has likely updated the SSH server to listen on a non-standard port (2222), but the firewall rules were not updated to allow connections on this new port. The firewall-cmd command with the --add-port option allows traffic on a specific port through the firewall. The command should be executed on myhost to permit incoming SSH connections on port 2222.