为某个用户增加 sudo 权限
2013-03-05 17:04
134 查看
修改/etc/sudoers文件
方法一(不推荐)
#visudo -f /etc/sudoers在root ALL=(ALL) ALL 之后增加
tom ALL=(ALL) ALL Defaults:tom timestamp_timeout=2,runaspw# 增加普通账户tom的sudo权限
# timestamp_timeout=-1 只需验证一次密码,以后系统自动记忆,这里设的是 2 分钟
# runaspw 需要root密码,如果不加默认是要输入普通账户的密码
方法二(推荐)
注:如果软件升级, /etc/sudoers 可能会被覆盖掉,所以好的习惯是在 /etc/sudoers.d 中添加在 /etc/sudoers.d 目录中增加一个文件,添加相同的内容
tom ALL=(ALL) ALL Defaults:tom timestamp_timeout=2,runaspw
注意(如果发现没有成功,看是否满足下面2个条件):
1. The file in /etc/sudoers do not end in '~' or contain a '.' character
2. 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.
(/etc/sudoers.d/README in Ubuntu)
修改 PATH
修改普通用户的.bash_profile文件(vi /home/tom/.bash_profile),在PATH变量中增加/sbin:/usr/sbin:/usr/local/sbin:/usr/kerberos/sbin
相关文章推荐
- linux(ubuntu)为用户增加sudo权限
- 增加用户的sudo权限
- 创建一个非超级管理员用户,并增加 sudo 权限
- Linux增加新用户,给用户配置sudo权限
- 创建Ubuntu用户以及让新用户增加sudo权限
- linux 增加用户 改密码 增加sudo权限
- Linux给用户增加sudo权限
- Ubuntu如何增加用户及赋予sudo权限
- CentOS为普通用户增加sudo权限
- CentOS学习5_为CentOS普通用户增加sudo操作权限
- 为用户增加sudo权限(修改sudoers文件)
- ubuntu为用户增加sudoer权限的两种方法
- 为用户增加sudo权限(修改sudoers文件)
- linux增加用户并赋予sudo权限
- CentOS普通用户增加sudo权限的简单配置
- 增加普通用户的sudo权限,禁止root用户登录
- redhat下给普通用户增加sudo命令,让他可以获得修改等权限
- Ubuntu增加sudo权限用户
- redhat enterprise linux普通用户增加sudo权限
- ubuntu14.04增加一个用户并且给予sudo的权限