サンドボックスVM環境で、ファイアウォールで保護されており、ローカルシステムの外部からアクセスできないUbuntuLinuxのセットアップがあります。したがって、そのVMで、管理ユーザー(私が設定した)にsudoを使用して、パスワードを必要とせずに何でも実行できるようにしたいのです。
これは安全ではないことはわかっていますが、このVMは常にオンになっているわけではなく、実行するには個人のパスコードが必要です。したがって、これは「安全」ではありませんが、目的の機能を取得する方法はありますか?
承認された回答:
man sudoersから:
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.
もう1つのタグはALL
です 、ユーザーrayがパスワードなしで任意のホストで任意のコマンドを実行できるようにするには:
ray ALL= NOPASSWD: ALL