43
47

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.

特定ユーザにのみtty無しでのsudoを認める

Last updated at Posted at 2014-05-10

VagrantやServerspecを使っている時など、ttyなしでsudoができるように /etc/sudoers から下記の記述をコメントアウトすることがありますが、これだと権限を持つ全てのユーザがttyなしでsudoを実行できるようになってしまいます。

/etc/sudoers
#Defaults      requiretty

全ユーザではなく、特定のユーザだけにttyなしでのsudoを認めるには次のように書きます。

/etc/sudoers
Defaults           requiretty
Defaults:username !requiretty

参考

  • sudoers(5)
    • Defaults
    • SUDOERS OPTIONS
43
47
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
43
47

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?