1
0

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.

端末がない状態で sudo を使う

Posted at

cron など端末がない状態で sudo を使うと、例えば ssh では次のようになる

$ ssh some_host sudo ls
sudo: sorry, you must have a tty to run sudo

端末が無いとプログラムは echo back を止めることができないので、sudo のパスワードが丸見えになってしまう。
なので端末の有無を sudo は見ているのだけど、NOPASSWD を指定しているユーザではこの制限はいらない。

%wheel ALL=(ALL) NOPASSWD: ALL
Defaults:%wheel !requiretty

としておいた。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?