web-dev-qa-db-ja.com

sudoersファイル内のChown:安全かどうか?

このコマンドをsudoersファイルに追加しても安全ですか?

mike ALL= NOPASSWD:/bin/chown -R www-data\:www-data /var/www

これは私が実行したい唯一のコマンドです

$mike@ubuntu: Sudo chown -R www-data:www-data /var/www

ありがとうございました。

8
Mike

はい。

man sudoersから:

   If a Cmnd has associated command line arguments, then the arguments in
   the Cmnd must match exactly those given by the user on the command line
   (or match the wildcards if there are any).  Note that the following
   characters must be escaped with a '\' if they are used in command
   arguments: ',', ':', '=', '\'.  The special command "sudoedit" is used
   to permit a user to run Sudo with the -e option (or as sudoedit).  It
   may take command line arguments just as a normal command does.
7
Andrew B