设置当前登陆用户sudo免密

假设当前用户名为user1
使用visudo打开sudoers并编辑
sudo visudo
在刚才编辑的内容中加上NOPASSWD:
user1  ALL=(ALL:ALL) NOPASSWD: ALL
保存即可。