sudo without enter password

Posted by – October 10, 2010

1、使用root权限运行以下命令:
[bash]
visudo
[/bash]

2、把/etc/sudoers(自动打开)裡面最後一行:
[bash]
%admin ALL=(ALL)ALL
[/bash]

改為:
[bash]
%admin ALL=(ALL) NOPASSWD: NOPASSWD: ALL
[/bash]

1 Comment on sudo without enter password

  1. mosjin says:

    # User alias specification
    User_Alias SYSRoot=root,jin,alice

    # Cmnd alias specification

    # User privilege specification
    SYSRoot ALL=(ALL) ALL
    SYSRoot ALL=(root) NOPASSWD:/bin/ls
    SYSRoot ALL= NOPASSWD:/tmp/ls.pl
    SYSRoot ALL = (root) ALL
    jin ALL=(ALL) NOPASSWD:/usr/local/echoHello,/usr/bin/sudoedit,/usr/bin/sudo

Leave a Reply