ubuntu使用sudo时不用输入密码
2016-11-20 01:26
573 查看
查看/etc/sudoers
该文件的权限为
所以通常不建议直接修改该文件
/etc/sudoers文件最后包含了一个目录/etc/sudoers.d
只需要将用户设置在该目录内的一个文件中即可
文件不要以~结尾或包含点.
使用命令sudo visudo -f /etc/sudoers.d/users增加文件
并在文件中添加
user ALL= NOPASSWD: ALL
# # This file MUST be edited with the 'visudo' command as root. # # Please consider adding local content in /etc/sudoers.d/ instead of # directly modifying this file. # # See the man page for details on how to write a sudoers file. # Defaults env_reset Defaults mail_badpass Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" # Host alias specification # User alias specification # Cmnd alias specification # User privilege specification root ALL=(ALL:ALL) ALL # Members of the admin group may gain root privileges %admin ALL=(ALL) ALL # Allow members of group sudo to execute any command %sudo ALL=(ALL:ALL) ALL # See sudoers(5) for more information on "#include" directives: #includedir /etc/sudoers.d
该文件的权限为
-r--r----- 1 root root 745 Feb 11 2014 /etc/sudoers
所以通常不建议直接修改该文件
/etc/sudoers文件最后包含了一个目录/etc/sudoers.d
只需要将用户设置在该目录内的一个文件中即可
文件不要以~结尾或包含点.
使用命令sudo visudo -f /etc/sudoers.d/users增加文件
并在文件中添加
user ALL= NOPASSWD: ALL
相关文章推荐
- 使用sudo命令不用输入密码的方法探究
- 使ubuntu10.10中sudo不用输入密码
- 【Ubuntu使用技巧】ubuntu sudo不需要输入密码
- 在ubuntu7.10中sudo不用输入密码的方法
- Linux/Ubuntu sudo不用输入密码的方法
- Linux/Ubuntu sudo不用输入密码的方法(转)
- Linux/Ubuntu sudo不用输入密码的方法
- Linux/Ubuntu sudo不用输入密码的方法
- Linux/Ubuntu sudo不用输入密码的方法
- Ubuntu下输入sudo时如何不用输入密码?
- linux下普通用户使用sudo不用输入密码的方法
- Linux/Ubuntu sudo不用输入密码的方法
- ubuntu的sudo不用每次都输入密码解决办法
- [转]Linux/Ubuntu sudo不用输入密码的方法
- 【Ubuntu使用技巧】ubuntu sudo不需要输入密码
- Linux/Ubuntu sudo不用输入密码的方法
- (Mark) (Ubuntu)Ubuntu sudo 不用输入密码 (Linux) (密码)
- 在使用sudo命令时如何不用输入密码或减少输入的次数?
- Linux/Ubuntu sudo不用输入密码的方法
- ubuntu 设置su,sudo不用输入密码