“sudo -v”在 sudoers-man-page 中代表什么

Ulf*_*lfR 2 sudo

这个问题的基础是这个答案。在 sudoers 手册页中指出:

时间戳超时

在 sudo 再次要求输入密码之前可以经过的分钟数。

...

这可用于允许用户分别通过“sudo -v”和“sudo -k”创建或删除自己的时间戳。

在关于create的最后一句中,这里实际指的是什么?

这可用于允许用户通过“sudo -v”创建......他们自己的时间戳......

sudo -v命令已经存在并且不依赖于timestamp_timeout我所看到的。那么手册页中的信息在哪里以及如何提供帮助?什么是实际用例?

mur*_*uru 6

sudo手册页

-v, --validate
     Update the user's cached credentials, authenticating the user
     if necessary.  For the sudoers plugin, this extends the sudo
     timeout for another 15 minutes by default, but does not run a
     command.  Not all security policies support cached
     credentials.
Run Code Online (Sandbox Code Playgroud)

假设 sudo 允许超时(timestamp_timeout大于零),重复使用的长时间运行的脚本sudo可以sudo -v在后台循环运行,因此用户只需在脚本开始时验证sudo 一次。然后后台sudo -v循环将继续延长超时时间(每次创建一个更新的时间戳)。我见过需要sudo多次调用的软件安装脚本,由于下载,每个步骤可能需要很长时间才能完成,sudo -v以这种方式使用。