Problem using sudo command as normal user


#1

Hello everyone

I have failed to use the sudo command as a normal user as in the error below:

The user akili from the output above is the default user i created while installing Linux mint on my machine.

I have got some solution of including the normal user in the sudoers file but i would like to know some of the possible causes of the is error?

What activities on the system can cause a default user to lose permission to use the sudo command?


#2

How you configured sudo file, can you please share it


#3

Here is my sudoers file


#4

You have to add your username in sudoers file under root for giving limited accesses or full accesses to that user.

for ex:

akili ALL=(ALL) ALL

once look at the below screen shot you will get an idea and one more thing always use

#visudo

for editing sudoers file


#5

@raghuu

Thanks for the solution. So what could be the cause of this?


#6

Are you trying to run

#sudo su

or

#sudo -s 

run sudo su and check still you are able to see that error message or not


#7

I was trying to run

$sudo -s

Now i can not see the error after adding user akili to the sudoers file. Many thanks.:joy:


#8

You are welcome instead of editing sudoers file always use below command

#visudo

the beauty of visudo is it will prompt you an warning message if you did any syntax error with in the file


#9

Hi guys,

I have a similar question.

I was told never, ever, N E V E R to edit the file. Only use visudo like this:

EDITOR=nano visudo

My question is - why? I mean, If I can edit all other files normally, and change anything, and if it’s true that in Linux everything is a file, then why can’t I just edit sudoers file like any other.

Maybe there are other similar files,I’m not sure.

Sorry for jumping in, it was just on my mind at the moment and I felt like I could ask here.

Thanks


#10

@BrankoTesla

When you edit the sudoers file directly, you can not be able to catch errors while editing the original file but using the visudo command, the syntax used is enabled and this allows you to catch errors easily.


#11

I’m confused. If you’re using Linux Mint…then couldn’t you have logged in with the user in question…then gone to Terminal and entered “sudo bash”?..which would have prompted you for the “Root” user’s password to allow the “Standard” user do what needs to be done? Or is that you were INTENTIONALLY trying to do it the way you did?..just trying to get a handle on it…not trying to be asinine…


#12

@Eddie_O_Connor

Yes i logged as the user in question(akili) from the screen shot in the question then i received the error message as you can see from the stderr message.

What do you think could have caused that?