ルートアカウントを有効にしています。ユーザー(ケネスなど)を標準アカウントに格下げし、sudoersでDefaults rootpw
フラグを設定しました。
Sudoを使用すると、ルートパスワードの入力が正しく求められますが、
kenneth is not in the sudoers file. This incident will be reported.
ここでこの質問をしています(AskUbuntu)。他に3つのLinuxシステムがありますが、同じ問題はそこで発生しません。知っておく必要のある違い(Ubuntuにのみ適用される重要な変更)がありますか?
sudoersファイル
#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults rootpw
Defaults env_reset
Defaults mail_badpass
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specification
root ALL=(ALL:ALL) ALL
# Members of the admin group may gain root privileges
#%admin ALL=(ALL) ALL
# Allow members of group Sudo to execute any command
%Sudo ALL=(ALL:ALL) ALL
# See sudoers(5) for more information on "#include" directives:
#includedir /etc/sudoers.d
グループケネス
kenneth : kenneth cdrom dip adm plugdev lpadmin sambashare vboxusers
グループルート
root : root Sudo
私の理解では、rootpw
はパスワードプロンプトの動作を変更するだけです。ユーザーには(明示的に、またはグループを介して)/etc/sudoers
という名前を付ける必要があります。
この場合、kenneth
はそうではありません。それを修正すると、これが機能するはずです。
余談ですが、これはSudo
を本当に逆方向に使用しているように見えます。これはまさに防止するためにSudo
が考案された種類の動作です。 su
も同様です。