假设用户是speak
1.echo "speak ALL = (root) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/speaksudo
2.chmod 0440 /etc/sudoers.d/speaksudo
3.sed -i s'/Defaults requiretty/#Defaults requiretty'/g /etc/sudoers
本文共 249 字,大约阅读时间需要 1 分钟。
假设用户是speak
1.echo "speak ALL = (root) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/speaksudo
2.chmod 0440 /etc/sudoers.d/speaksudo
3.sed -i s'/Defaults requiretty/#Defaults requiretty'/g /etc/sudoers
转载于:https://www.cnblogs.com/zhong12322/p/10596222.html