122
127

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?