# 以root用戶登陸執(zhí)行命令
visudo
# 找到下面這里
### Allow root to run any commands anywhere
# root ALL=(ALL) ALL
# 在這一行下面,增加如下內(nèi)容,,account就是你的賬號名
account ALL=(ALL) ALL
sudo命令不再重復輸入password
# 以root用戶登陸執(zhí)行命令
visudo
# 找到這里
### Same thing without a password
# %wheel ALL=(ALL) NOPASSWD: ALL
# 在下面加上這樣一句話,account是賬戶名
%account ALL=(ALL) NOPASSWD: ALL
# 這樣就不用每次都輸入密碼了