(1) sudo用户免密,修改/etc/sudoers文件
%sudo ALL=(ALL:ALL) NOPASSWD:ALL
(2)我第一次修改错误导致sudo文件不可读,没有备份,然后所有的sudo操作无法进行
错误举例:
%sudo ALL=(ALL:ALL) NOPASSWORD:ALL
执行pkexec visudo,修改如下,保存并覆盖原文件:
%sudo ALL=(ALL:ALL) NOPASSWD:ALL
pkexec这个命令的解释是allows an authorized user to executePROGRAMas another user. Ifusernameis not specified, then the program will be executed as the administrative super user,root. 可能可以用于安全测试。
© 版权声明
文章版权归作者所有,未经允许请勿转载。
相关文章
暂无评论...