nerdexam
CompTIA

SK0-005 · Question #275

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…

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…

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

How the community answered

(49 responses)
  • A
    2% (1)
  • B
    90% (44)
  • C
    6% (3)
  • D
    2% (1)

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 Practice