您尚未登录。

#1 2013-05-02 15:26:46

rmn190
会员
注册时间: 2013-04-26
帖子: 79

如何设置sudo时提示输入密码?

rt

离线

#2 2013-05-02 16:22:21

phoenixlzx
晩ご飯だよー
注册时间: 2011-08-19
帖子: 1,789
个人网站

Re: 如何设置sudo时提示输入密码?

默认就是要输入密码的,除非你的sudoer文件些的是 NOPASSWORD

离线

#3 2013-05-02 17:57:53

rmn190
会员
注册时间: 2013-04-26
帖子: 79

Re: 如何设置sudo时提示输入密码?

phoenixlzx 说:

默认就是要输入密码的,除非你的sudoer文件些的是 NOPASSWORD

多谢回复和提醒。

这里记录下修改过程:

-----------

执行“sudo visudo”命令,修改文件:

%wheel ALL=(ALL) NOPASSWD: ALL

改成:


%wheel ALL=(ALL) PASSWD: ALL

也就是把NOPASSWD改成“PASSWD”。

这时, 再执行sudo时, 就提示要输入密码了。

不过, 这里有一个有意思的事儿, 我改后, 第一次执行sudo时, 给出了这样的信息:
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.


后边再执行时, 就不会再用了。

离线

#4 2013-05-02 18:30:47

依云
会员
所在地: a.k.a. 百合仙子
注册时间: 2011-08-21
帖子: 8,384
个人网站

Re: 如何设置sudo时提示输入密码?

rmn190 说:

不过, 这里有一个有意思的事儿, 我改后, 第一次执行sudo时, 给出了这样的信息:
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.


后边再执行时, 就不会再用了。

才发现最后一点是倒装句呢。

离线

#5 2013-05-02 19:57:05

xgdgscarch
会员
注册时间: 2012-05-07
帖子: 191

Re: 如何设置sudo时提示输入密码?

百合仙子 说:
rmn190 说:

不过, 这里有一个有意思的事儿, 我改后, 第一次执行sudo时, 给出了这样的信息:
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.


后边再执行时, 就不会再用了。

才发现最后一点是倒装句呢。

蜘蛛侠。

离线

#6 2013-05-02 21:50:03

cuihao
所在地: USTC, Hefei
注册时间: 2011-08-19
帖子: 1,222
个人网站

Re: 如何设置sudo时提示输入密码?

百合仙子 说:
rmn190 说:

不过, 这里有一个有意思的事儿, 我改后, 第一次执行sudo时, 给出了这样的信息:
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.


后边再执行时, 就不会再用了。

才发现最后一点是倒装句呢。

和“Noblesse oblige”是一个意思呢。


Site: CVHC.CC   Twitter: @cuihaoleo   Org: LUG@USTC
AD:  ~欢迎参与志愿计算~

离线

页脚