当我尝试将我的帐户设置为管理员时,每个人用来打开管理员的所有方法都对我不起作用。当我尝试sudo -i
或时sudo su
,它给了我这个输出,
usbuser123@Ubuntu2USB:~$ sudo -i
[sudo] password for usbuser123:
usbuser123 is not in the sudoers file. This incident will be recorded
usbuser123@Ubuntu2USB:~$ sudo su
[sudo] password for usbuser123:
Sorry, try again.
[sudo] password for usbuser123:
usbuser123 is not in the sudoers file. This incident will be recorded
这是一张图片: 终端图片
答案1
尝试这个 :
pkexec visudo
pkexec 是 sudo 的替代品
然后在组 sudo 成员下添加此行以执行任何命令:
# Allow members of group sudo to execute any command
add this line if doesnt exist
%sudo ALL=(ALL:ALL) ALL