LoginSignup
9
9

More than 5 years have passed since last update.

/etc/sudoersの#includedirの#はコメントアウトじゃない

Last updated at Posted at 2014-10-16

コンフィグを整理する時にコメントアウトを全部消しちゃうクセがあるのですが、
(だってApacheのコンフィグとか8割がたコメントじゃないですか・・・)
AmazonLinuxの/etc/sudoersのコメントを消したらなんかec2-userからsudoできなくなった・・・

[ec2-user@xxx ~]$ sudo su -
[sudo] password for ec2-user: 

AmazonLinuxにはrootユーザのパスワードが設定されてなくて、ec2-userからsudoするのですが、その設定は/etc/sudoers.d/cloud-initに書いてあります。

ec2-user ALL = NOPASSWD: ALL

# User rules for ec2-user
ec2-user ALL=(ALL) NOPASSWD:ALL

これをincludeする/etc/sudoersの設定を見てみると、

...
## Read drop-in files from /etc/sudoers.d (the # here does not mean a comment)
#includedir /etc/sudoers.d

『#include』の#はコメントじゃなかったんですね・・・
ミスって消しちゃったよ\(^o^)/
よく見ると直上のコメントに『この#はコメントじゃないぞ!絶対消すなよ!』って書いてあった・・・

9
9
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
9
9