linux提权免密

sudo,kdesu,Polkit 的单行提权命令

wheel组提权免密

arch系可以安装aur中我写的nopasswd

  • sudo
1
echo '%wheel ALL=(ALL) NOPASSWD: ALL' | sudo tee -a /etc/sudoers
  • kdesu

Octopi 免弹窗, 依赖sudo免密

1
kwriteconfig5 --file kdesurc --group super-user-command --key super-user-command sudo
  • Polkit

系统设置免弹窗

1
echo 'polkit.addRule(function(action, subject) {if (subject.isInGroup("wheel")) {return polkit.Result.YES;}});' | sudo tee /etc/polkit-1/rules.d/49-nopasswd_global.rules