假设用户是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