Ubuntu新用户报xxx is not in the sudoers file... 错误解决方法

本文介绍了解决Linux系统中用户无法使用sudo命令的问题。通过修改sudoers文件,将用户添加到sudo组,从而允许该用户执行管理员级别的操作。文章详细记录了从创建用户、安装软件遇到权限错误到成功解决问题的全过程。

新建用户

sudo useradd today -m -s /bin/bash

sudo passwd today

Enter new UNIX password:

Retype new UNIX password:

 

当前用户切换至today安装atop、htop等包

sudo /bin/su - today

sudo apt-get install htop atop

[sudo] password for today:

today is not in the sudoers file. This incident will be reported.

这里报“xxx is not in the sudoers file.This incident will be reported”

 

解决方法

chmod u+w /etc/sudoers

echo "today ALL=(ALL) ALL">>/etc/sudoers

chmod u-w /etc/sudoers

 

转载于:https://my.oschina.net/HeAlvin/blog/2050972

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值