102-500日本語 無料問題集「Lpi LPIC-1 Exam 102, Part 2 of 2, version 5.0 (102-500日本語版)」
どのファイルがどのユーザーがsudoを使ってコマンドを実行できるかをリストしますか? (パスを含むファイルのフルネームを指定してください。)
正解:
etcsudoers
Explanation:
The /etc/sudoers file lists which users can execute commands using sudo, as well as which commands they can run, on which hosts, and as which users. The /etc/sudoers file is the main configuration file for the sudo command, which allows users to run commands as another user, usually the superuser or root. The /etc/sudoers file has a specific syntax and should be edited only with the visudo command, which checks the file for errors and locks it to prevent concurrent edits. The /etc/sudoers file contains entries that follow the format:
user host = (runas) command
where user is the name of the user who can run sudo, host is the name of the host where the user can run sudo, runas is the name of the user as whom the command will be executed, and command is the name of the command or a list of commands that the user can run with sudo. For example, the entry:
alice ALL = (root) /bin/ls, /usr/bin/whoami
means that the user alice can run sudo on any host, and can execute the commands /bin/ls and /usr/bin/whoami as the root user. The /etc/sudoers file also supports aliases, variables, wildcards, and other features that make it more flexible and powerful. For more details, see the sudoers manual page.
Reference:
LPIC-1 Exam 102 Objectives, Topic 110: Security, Subtopic 110.2: Use sudo to manage access to the root account, Weight: 2, Key Knowledge Areas: Configure sudo and sudoers. Use sudo to execute commands as another user.
LPIC-1 Exam 102 Learning Materials, Topic 110: Security, Subtopic 110.2: Use sudo to manage access to the root account, Section 110.2.1: sudo and sudoers, Page 3-5.
Explanation:
The /etc/sudoers file lists which users can execute commands using sudo, as well as which commands they can run, on which hosts, and as which users. The /etc/sudoers file is the main configuration file for the sudo command, which allows users to run commands as another user, usually the superuser or root. The /etc/sudoers file has a specific syntax and should be edited only with the visudo command, which checks the file for errors and locks it to prevent concurrent edits. The /etc/sudoers file contains entries that follow the format:
user host = (runas) command
where user is the name of the user who can run sudo, host is the name of the host where the user can run sudo, runas is the name of the user as whom the command will be executed, and command is the name of the command or a list of commands that the user can run with sudo. For example, the entry:
alice ALL = (root) /bin/ls, /usr/bin/whoami
means that the user alice can run sudo on any host, and can execute the commands /bin/ls and /usr/bin/whoami as the root user. The /etc/sudoers file also supports aliases, variables, wildcards, and other features that make it more flexible and powerful. For more details, see the sudoers manual page.
Reference:
LPIC-1 Exam 102 Objectives, Topic 110: Security, Subtopic 110.2: Use sudo to manage access to the root account, Weight: 2, Key Knowledge Areas: Configure sudo and sudoers. Use sudo to execute commands as another user.
LPIC-1 Exam 102 Learning Materials, Topic 110: Security, Subtopic 110.2: Use sudo to manage access to the root account, Section 110.2.1: sudo and sudoers, Page 3-5.