Báo lỗi is not in the sudoers file anywhere
Both the above answers are correct as far as they go but it is easier to add your user to the sudo group in debian based systems (Ubuntu, kbuntu, debian, etc) and the wheel group under RedHat based systems (RedHat, Fedora, CentOS, etc)
answered Dec 14, 2017 at 10:13
This is a very common error for the beginners. The error occurs because we are trying to access/update something with super privileges from the user instead of root -user.
Hence, to solve this,we need to make changes in the sudoers file where the root user has been given the privileges. So, switch to root user,run the following command
The editor would open the file, now scroll down to the bottom where you will see a line
As you can see, I have just added my username with all permissions.
Save the file, and exit. Switch back to the user and start using sudo commands with ease.
answered Jul 20, 2019 at 12:12
5895 silver badges7 bronze badges
At the top of the aforementioned
6 file there's an info:
In order of doing as we're told, use:
Find the following section of
6 file and add your users privileges:
Save the file (press esc and type
8 if vim is your default text editor, for nano press ctrl+o, enter and then ctrl+x).
9 to turn off the
0 shell, and enjoy the power of
1 with your
answered Dec 9, 2019 at 20:06
10.9k14 gold badges59 silver badges81 bronze badges
Got a slightly different syntax to Rodney's from my host
Their explanation was
The user will need to be added to the wheel group. Use the usermod command to add the user to the wheel group.
You may need to log off and log back in after doing this
answered Jul 5, 2018 at 15:41
Robert SinclairRobert Sinclair
4,6712 gold badges44 silver badges46 bronze badges
You should use
3 to edit /etc/sudoers file.
and add your username with correct syntax and access rights. You can find more in
80710 silver badges26 bronze badges
answered Dec 14, 2017 at 9:39
answered Jun 13, 2019 at 19:20
Braian CoronelBraian Coronel
22.2k4 gold badges58 silver badges62 bronze badges
If you're unable to find visudo on your system
Launch this tool
add this line under
User privilege specification
Save the changes and here you go !
answered May 11, 2020 at 12:19
Olivier D'AnconaOlivier D'Ancona
8012 gold badges15 silver badges30 bronze badges
First, switch/ log into the root user account or an account that has sudo privileges.
Next add the user to the group for sudo users:
Note: Replace username with your desired
To test the sudo access, log into the account that you just added to the sudo users grouP, and then run the command below using
You will be prompted to enter the password. If the user have sudo access, the output will be:
If you get an error saying user is not in the sudoers file, it means that the user doesn’t have sudo privileges yet.
I hope this helps
answered Sep 18, 2020 at 14:34
Promise PrestonPromise Preston
25.2k13 gold badges149 silver badges150 bronze badges
try this video, it works for me.
31.3k25 gold badges88 silver badges134 bronze badges
answered Dec 30, 2020 at 3:35
Add your user to the list of sudoers. This will make it easier to execute commands as the user that you have created will require admin privileges.