ユーザーがパスワードなしでsudoを使用できるようにする

ユーザーがパスワードなしでsudoを使用できるようにする

サンドボックス仮想マシン環境にはUbuntu Linuxがインストールされていますが、ファイアウォールで保護されているため、ローカルシステムの外部からアクセスできません。したがって、その仮想マシンで(私が設定した)管理ユーザーに、パスワードなしでsudoを使用して何でも実行できる機能を提供したいと思います。

これは安全ではないことを知っていますが、仮想マシンが常にオンになっているわけではなく、実行するには個人用パスワードが必要です。したがって、これが「安全」でなくても必要な機能を得る方法はありますか?

ベストアンサー1

~から万寿石:

   NOPASSWD and PASSWD

   By default, sudo requires that a user authenticate him or herself
   before running a command.  This behavior can be modified via the
   NOPASSWD tag.  Like a Runas_Spec, the NOPASSWD tag sets a default for
   the commands that follow it in the Cmnd_Spec_List.  Conversely, the
   PASSWD tag can be used to reverse things.  For example:

    ray  rushmore = NOPASSWD: /bin/kill, /bin/ls, /usr/bin/lprm

   would allow the user ray to run /bin/kill, /bin/ls, and /usr/bin/lprm
   as root on the machine rushmore without authenticating himself.

ALLユーザーrayがパスワードなしですべてのホストですべてのコマンドを実行できるようにするもう1つのタグは次のとおりです。

ray ALL= NOPASSWD: ALL

おすすめ記事