LoginSignup
6
4

More than 5 years have passed since last update.

sudo のパスワードなしの設定メモ

Posted at

OS:ubuntu14.04

visudoでパスワードなしに設定したものの、なぜかパスワードを聞かれてしまう。
でも、sudoは実行できる。

原因は、sudoersの中の書く位置でした。

こうあるので、rootの下に書いていたのですが、

# User privilege specification
root    ALL=(ALL:ALL) ALL
hoge    ALL=NOPASSWD: ALL

その下の方のこちらに書いてないとだめでした。
上で書いていても、%sudoの行が上書きしてしまうのかな。

# Allow members of group sudo to execute any command
%sudo   ALL=(ALL:ALL) ALL
hoge    ALL=NOPASSWD: ALL

これで無事パスワードを聞かれなくなりました。

6
4
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
6
4