Linux||报错:vboxuser is not in the sudoers file. This incident will be reported.

一、问题描述

        打算在Ubuntu虚拟机上部署SonarQube时,为避免各种不必要的奇怪问题,预先使用sudo命令修改系统参数。

        命令如下:sudo sysctl -w vm.max_map_count=262144

        报错如下:vboxuser is not in the sudoers file. This incident will be reported.

二、原因分析

        vboxuser没有sudo权限,需在/etc/sudoers系统文件添加vboxuser  ALL=(ALL)  ALL语句

三、解决方法

        在/etc/sudoers系统文件添加vboxuser的sudo权限,操作步骤如下:

        1、切换为超级用户:$ su  (由$变为#表示切换成功)

        2、使用vi编辑器打开/etc/sudoers文件:# vi /etc/sudoers

        3、按i键进入vi编辑器的编辑模式,找到“root  ALL=(ALL)  ALL”一行,在下面插入“vboxuser  ALL=(ALL)  ALL”语句,按Esc键退出编辑模式,然后键入命令“wq!”保存并退出。

        4、输入命令more /etc/sudoers查看是否成功保存,图中为保存成功

        5、退出超级用户切换为普通用户:$ exit   (由#变为¥表示切换成功)

        6、再次执行sudo命令,不再报错

附:如在使用vi编辑器修改文件时,按上下左右键文件内会出现字母,解决方法如下

Linux||使用vi编辑器按上下键输出字母_Inochigohan的博客-CSDN博客icon-default.png?t=M85Bhttps://blog.csdn.net/Inochigohan/article/details/128205812?spm=1001.2014.3001.5502

  • 5
    点赞
  • 41
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
回答: 当在终端输入大多数指令时,如果出现"vboxuser is not in the sudoers file"的报错,这是因为Ubuntu用户没有被添加到sudo中。解决这个问题的方法如下:首先,关机并切换到之前的用户登录,然后切换到root权限,可以使用命令"sudo -s"。接下来,为sudoers文件添加权限,可以使用命令"chmod u+x /etc/sudoers"。然后,编辑sudoers文件,为新用户提升权限,可以使用命令"gedit /etc/sudoers"。在"root ALL=(ALL:ALL) ALL"下添加"user ALL=(ALL:ALL) ALL",保存退出。最后,关机并切换到新的用户,此时新用户就可以切换到root权限了。\[1\]\[2\] #### 引用[.reference_title] - *1* [ubuntu用户出现vboxuser is not in the sudoers file报错时解决办法](https://blog.csdn.net/g65775005/article/details/128754296)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [user is not in the sudoers file.This incident will be reported](https://blog.csdn.net/weixin_45208598/article/details/105787191)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [Linux||报错vboxuser is not in the sudoers file. This incident will be reported.](https://blog.csdn.net/Inochigohan/article/details/128206433)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值