设置 ubuntu sudo 时不用输密码
2014-07-02 01:15
225 查看
先提一下我的系统:LinuxMint 17 xfce 32-bits(基于 ubuntu 14.04 LTS)
ubuntu sudo 时输密码可烦人了,其实解决起来也不难,请看
我们先看看 sudo 的配置文件 $sudo cat /etc/sudoers
#
# 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.
在注释中我们可以看到系统为了安全起见,不建议我们直接编辑这个配置文件(万一处理不好可能你就没法使用 sudo 了),而是编辑 /etc/sudoers.d/ 目录下的文件。好,我们就进入 /etc/sudoers.d/ 来看看
$ ls
mintupdate README
养成一个好习惯,先看 README ,
$sudo cat README
#
# As of Debian version 1.7.2p1-1, the default /etc/sudoers file created on
# installation of the package now includes the directive:
#
# #includedir /etc/sudoers.d
#
# This will cause sudo to read and parse any files in the /etc/sudoers.d
# directory that do not end in '~' or contain a '.' character.
#
# Note that there must be at least one file in the sudoers.d directory (this
# one will do), and all files in this directory should be mode 0440.
好了,此时你应该知道怎么做了吧,touch 一个文件 nopasswd4sudo,内容如下,
yourusername ALL=(ALL) NOPASSWD: ALL
完成之后,记得按要求 sudo chmod 0440 nopasswd4sudo 哦
更改完之后,sudo apt-get update 直接就更新了,说明sudo每次执行时都会先查看 /etc/sudoers.d/ 目录下的文件的
ubuntu sudo 时输密码可烦人了,其实解决起来也不难,请看
我们先看看 sudo 的配置文件 $sudo cat /etc/sudoers
#
# 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.
在注释中我们可以看到系统为了安全起见,不建议我们直接编辑这个配置文件(万一处理不好可能你就没法使用 sudo 了),而是编辑 /etc/sudoers.d/ 目录下的文件。好,我们就进入 /etc/sudoers.d/ 来看看
$ ls
mintupdate README
养成一个好习惯,先看 README ,
$sudo cat README
#
# As of Debian version 1.7.2p1-1, the default /etc/sudoers file created on
# installation of the package now includes the directive:
#
# #includedir /etc/sudoers.d
#
# This will cause sudo to read and parse any files in the /etc/sudoers.d
# directory that do not end in '~' or contain a '.' character.
#
# Note that there must be at least one file in the sudoers.d directory (this
# one will do), and all files in this directory should be mode 0440.
好了,此时你应该知道怎么做了吧,touch 一个文件 nopasswd4sudo,内容如下,
yourusername ALL=(ALL) NOPASSWD: ALL
完成之后,记得按要求 sudo chmod 0440 nopasswd4sudo 哦
更改完之后,sudo apt-get update 直接就更新了,说明sudo每次执行时都会先查看 /etc/sudoers.d/ 目录下的文件的
相关文章推荐
- ubuntu 设置su,sudo不用输入密码
- ubuntu sudo设置命令不用输密码
- Linux/Ubuntu sudo不用输入密码的方法(转)
- 使ubuntu10.10中sudo不用输入密码
- Ubuntu sudo不用密码
- ubuntu下设置root权限不用输入密码
- ubuntu使用sudo时不用输入密码
- Ubuntu 设置当前用户sudo免密码
- Ubuntu/fedora实用小技巧—禁止自动锁屏、设置免密码自动登录、免密码执行sudo操作
- Linux/Ubuntu sudo不用输入密码的方法
- ubuntu 下 sudo 不用输密码
- Linux系列:Ubuntu/fedora实用小技巧—禁止自动锁屏、设置免密码自动登录、免密码执行sudo操作
- ubuntu的sudo不用每次都输入密码解决办法
- Linux/Ubuntu sudo不用输入密码的方法
- Linux/Ubuntu sudo不用输入密码的方法
- Linux/Ubuntu sudo不用输入密码的方法
- (Mark) (Ubuntu)Ubuntu sudo 不用输入密码 (Linux) (密码)
- Linux系列:Ubuntu/fedora实用小技巧—禁止自动锁屏、设置免密码自动登录、免密码执行sudo操作
- Ubuntu设置su和sudo为不需要密码
- [转]Linux/Ubuntu sudo不用输入密码的方法