sunhn is not in the sudoers file. This incident will be reported
时间: 2023-12-06 08:38:04 浏览: 51
这个错误提示表明当前用户(sunhn)没有sudo权限,因此无法执行sudo命令。解决方法如下:
1. 以root用户身份登录系统。
2. 执行命令“visudo”打开sudoers文件。
3. 在文件中找到“root ALL=(ALL:ALL) ALL”这一行,在其下面添加“sunhn ALL=(ALL:ALL) ALL”(其中sunhn为你的用户名)。
4. 按下“ESC”键,输入“:wq”保存并退出文件。
5. 现在你的用户已经被授权使用sudo命令了。
相关问题
is not in the sudoers file. This incident will be reported.
"is not in the sudoers file. This incident will be reported."表示用户在尝试使用sudo命令时出现了错误,因为该用户不在sudoers文件中。解决该问题的方法有两种:手动修改和命令方式修改。
手动修改的步骤如下:
1. 使用命令"sudo chmod u+w /etc/sudoers"赋予sudoers文件写权限。
2. 使用命令"sudo vi /etc/sudoers"编辑sudoers文件,在对应的位置添加用户的sudo权限。例如,将"user ALL=(ALL:ALL) ALL"添加到文件中。
3. 使用命令"sudo chmod u-w /etc/sudoers"撤销sudoers文件的写权限。
命令方式修改的步骤如下:
1. 使用命令"sudo visudo"以root权限打开sudoers文件。
2. 在文件中找到相应位置,根据需要添加用户的sudo权限。参考手动修改中的步骤3.1。
以上两种方法都是基于现有用户拥有root权限进行操作的。
is not in the sudoers file. This incident will be reported
这是一个关于 Linux 系统权限的问题,我可以回答。这个错误提示意味着当前用户没有被授权执行 sudo 命令,需要使用 root 用户或者具有 sudo 权限的用户来执行该命令。如果您是系统管理员,可以通过修改 /etc/sudoers 文件来添加用户的 sudo 权限。
阅读全文
相关推荐















