1. 程式人生 > >執行sudo命令時的提示語,如何修改?

執行sudo命令時的提示語,如何修改?

defaults default 屏蔽 always web char pos something ref

如圖所示,執行sudo命令,提示語(有中文和英文兩個版本):

技術分享圖片

上面的提示內容是sudo軟件原生的內容。

使用下面的方法,有的時候是可行的。sudo -p ‘提示語‘ 命令

技術分享圖片

如果要修改sudo軟件原生的提示內容,只有重新編譯軟件。

屏蔽提示的方法:https://superuser.com/questions/500119/keeping-the-fancy-sudo-warning-forever

Create a file inside /etc/sudoers.d/ You can use this command

sudo vim /etc/sudoers.d/privacy

Now paste this line into the file ‘privacy

‘.

Defaults   lecture = always

Now close Terminal/console, Reopen it and try to do something with sudo.

Can I also disable the message by setting lecture to never? – Richard de Wit Jun 14 ‘17 at 10:16 Yes, the options for lecture are: always never once sudoers man – Chris Nov 28 ‘17 參考: https://www.ostechnix.com/change-sudo-prompt-linux-unix/
https://bbs.archlinux.org/viewtopic.php?id=39499 http://www.webjx.com/server/linux-18515.html

執行sudo命令時的提示語,如何修改?