LoginSignup
0
2

More than 5 years have passed since last update.

/etc/sudoers.dを使った時にハマったことと対処方法

Last updated at Posted at 2018-04-25

事象

sudoの設定を行う場合に、

/etc/sudoers

ではなく、

/etc/sudoers.d/hogehoge

を使おうとしてハマった。

原因と対処方法

上記の hogehoge においては . が使えないらしいので、 _ 等で代用しましょう

OKなパターン :ok_woman:

  • /etc/sudoers.d/iganari
  • /etc/sudoers.d/iganari_dev
  • /etc/sudoers.d/iganari-prd

NGなパターン :no_good:

  • /etc/sudoers.d/iganari.stg

理由

WIP

補足

そもそも、設定方法はvisudoが推奨

  • バリデートもしてくれるから、事故防止にもなる!

なぜ、 /etc/sudoers.d/ があるのか

  • 設定ファイルに書いてある
/etc/sudoers
## Read drop-in files from /etc/sudoers.d (the # here does not mean a comment)
#includedir /etc/sudoers.d

※ 上記の # コメントアウトでは無い(英語でもそのまま書いてある)

その他の参考資料

Qiitaで sudo をtag検索

過去にsudoについて書いた記事

0
2
0

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
0
2