执行sudo命令时的提示语,如何修改?

如图所示,执行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

 

posted @ 2018-06-26 21:42  脚本小娃子  阅读(889)  评论(0编辑  收藏  举报