LoginSignup
122
127

More than 5 years have passed since last update.

sudoers は編集せずに sudoers.d の中に設定を書こう

Posted at

他のディストリビューションは知りませんが RHEL/CentOS 6 や 7 なら /etc/sudoers.d/ の中に作成したファイルも sudoers として有効になります。

visudo -f /etc/sudoers.d/wheel

いつもこんな感じです。

%wheel ALL=(ALL) NOPASSWD: ALL
Defaults:%wheel !requiretty
Defaults:%wheel env_keep += SSH_AUTH_SOCK

RHEL/CentOS 5 でも /etc/sudoers に次の行を書いておけば /etc/sudoers.d/ を有効にできます。

#includedir /etc/sudoers.d

ぱっとみコメントアウトされているように見えますが、この # はコメントを意味するものではありません。#include#includedir だけは行頭の # がコメントにはなりません。

122
127
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
122
127