Linux xxx is not in the sudoers file.This incident will be reported
Linux大约 563 字切换到root用户
su root
添加sudo文件的写权限
chmod u+w /etc/sudoers
编辑sudoers文件
vi /etc/sudoers
找到这行 root ALL=(ALL) ALL,在他下面添加xxx ALL=(ALL) ALL (这里的xxx是你的用户名)
可以sudoers添加下面四行中任意一条
youuser ALL=(ALL) ALL
%youuser ALL=(ALL) ALL
youuser ALL=(ALL) NOPASSWD: ALL
%youuser ALL=(ALL) NOPASSWD: ALL
第一行:允许用户youuser执行sudo命令(需要输入密码).
第二行:允许用户组youuser里面的用户执行sudo命令(需要输入密码).
第三行:允许用户youuser执行sudo命令,并且在执行的时候不输入密码.
第四行:允许用户组youuser里面的用户执行sudo命令,并且在执行的时候不输入密码.
撤销sudoers文件写权限
chmod u-w /etc/sudoers
阅读 418 · 发布于 2019-04-01
————        END        ————
扫描下方二维码关注公众号和小程序↓↓↓

昵称:
随便看看换一批
- Android使用CountDownTimer类进行倒计时阅读 429
- 设计模式之责任链模式阅读 354
- VMware Workstation与Hyper-V不兼容阅读 1278
- HTML中用CSS实现搜索框内添加搜索图片阅读 764
- Nginx解决前端CORS跨域问题阅读 2104
- Android ListView条目上有CheckBox抢焦点的处理办法阅读 432
- MongoDB搭建分片集群阅读 179
- Android ContentLoadingProgressBar阅读 2974
- Golang时间加减、计算方法耗、毫秒转Time阅读 430
- IntelliJ Idea选择Open matching files in associated application后更改打开方式阅读 1874