nerdexam
CompTIACompTIA

SK0-005 · Question #275

SK0-005 Question #275: Real Exam Question with Answer & Explanation

The correct answer is B: sudo -1 -U userid. This is the best command to find out which commands can be used by a user with sudo privileges because it lists the allowed and forbidden commands for a given user or role. The -l option stands for list, and the -U option specifies the user name. The output of this command will s

Server administration

Question

A user logs in to a Linux server and attempts to run the following command: sudo emacs /root/file However, the user gets the following message: User userid is not allowed to execute 'emacs' on this server. Which of the following would BEST allow the user to find out which commands can be used?

Options

  • Avisudo | grep userid
  • Bsudo -1 -U userid
  • Ccat /etc/passwd
  • Duserlist | grep userid

Explanation

This is the best command to find out which commands can be used by a user with sudo privileges because it lists the allowed and forbidden commands for a given user or role. The -l option stands for list, and the -U option specifies the user name. The output of this command will show what commands can be executed with sudo by that user on that server.

Topics

#Sudo permissions#User access#Troubleshooting access

Community Discussion

No community discussion yet for this question.

Full SK0-005 PracticeBrowse All SK0-005 Questions