将一般的用户加入sudo组
来源:互联网 发布:株洲数控编程工资待遇 编辑:程序博客网 时间:2024/06/02 09:13
在一般用户下执行sudo命令提示xxx is not in the sudoers file. This incident will be reported.解决方法:
$whereis sudoers -------找出文件所在的位置,默认都是/etc/sudoers
有时候我们只需要执行一条root权限的命令也要su到root,是不是有些不方便?这时可以用sudo代替。默认新建的用户不在sudo组,需要编辑/etc/sudoers文件将用户加入,该文件只能使用visudo命令,
首先需要切换到root, su - (注意有- ,这和su是不同的,在用命令"su"的时候只是切换到root,但没有把root的环境变量传过去,还是当前用乎的环境变量,用"su -"命令将环境变量也一起带过去,就象和root登录一样)。
然后 visudo 或者 vim /etc/sudoers, visudo 这个和vi的用法一样
移动光标,到一行root ALL=(ALL) ALL的下一行,输入:your_user_name ALL=(ALL) ALL;
保存退出;
这样就把自己加入了sudo组,可以使用sudo命令了。
默认5分钟后刚才输入的sodo密码过期,下次sudo需要重新输入密码,如果觉得在sudo的时候输入密码麻烦,把刚才的输入换成如下内容即可:
your_user_name ALL=(ALL) NOPASSWD: ALL。
1 0
- 将一般的用户加入sudo组
- fedora将一般的用户加入sudo组
- ubuntu 将一般的用户加入sudo组 is not in the sudoers file
- Linux 将一般的用户加入sudo组is_not_in_the_sudoers_file._This_incident_will_be_reported解决方法
- 将一般的用户加入sudo组is not in the sudoers file. This incident will be reported解决方法
- 将一般的用户加入sudo组is not in the sudoers file. This incident will be reported解决方法
- Linux操作系统下将用户加入Sudo组的方法
- 将linux用户加入sudo组中
- Fedora 8中将用户加入Sudo组
- Linux中怎么将新建用户加入root组或者获取sudo权限
- Ubuntu将用户加入sudo list 且不需要密码
- 3、如何将用户加入sudo配置文件中
- linux 将用户(PeersLee)加入[sudo]用户组(centos 6.5默认该组没有此用户)|| 免密码使用【sudo】
- 将用户添加到sudo的方法
- Linux将用户加入组
- ubuntu中将用户加入sudo group的最好方法
- fedora将用户添加到sudo组
- linux 添加用户 将用户加入组
- Python数据结构与算法 7栈的应用之进制转换
- Android开发环境的搭建及HelloWorld
- 九度 1415 不一样的循环队列 【数据结构】
- Java虚拟机学习 - 对象访问
- 路由器实现负载均衡的三种模式解析
- 将一般的用户加入sudo组
- 设计模式--建造者模式(c#反射实现)
- 给初学者解释程序设计中内存外存的利用
- Javascript打造豆瓣FM的歌词插件
- 邮政储蓄银行储蓄卡银行预留手机号码问题
- linux给普通用户加 root权限
- 加工和交流
- 优秀前端学习资源汇总
- Collections集合工具类、Arrays工具类、其他常用类:System,Runtime,Date,Calendar,Math