ubuntu为用户配置免密码sudo权限

chmod u+w /etc/sudoers 

echo "用户名 ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers 

chmod u-w /etc/sudoers

试了各种办法,用visudo以及vim修改/etc/sudoers都不起作用.后面参考https://blog.csdn.net/db_guy/article/details/79065524的方法,可以正常使用.

参考

https://blog.csdn.net/db_guy/article/details/79065524

https://www.jianshu.com/p/84022a490211

猜你喜欢

转载自blog.csdn.net/Fenglin6165/article/details/88640621