Linux使用sudo时不需要输入密码的设置

打开终端,输入下面这条命令:

1
echo "`whoami` ALL=(ALL) NOPASSWD:ALL" | sudo tee "/etc/sudoers.d/dont-prompt-$USER-for-sudo-password"