0

I have a problem for permission using "sudo" on putty (connected to raspberry pi3).

My usrname is: karim My password: 0000 Each time, I have got this error when executing a command line " karim is not in the sudoers file. This incident will be reported"

What should I do to execute any command line as adminstrator in this case? Waiting your helps!! Have a grat day!!!

1

By default sudo on Raspbian is configured that a user being in group sudo can use it. So check if karim is in group sudo with:

karim@raspberrypi ~$ groups

If group sudo is not shown then you have to add karim to this group. The problem is that you have to be in group sudo to do it ...

Because user pi is in this group you have to logout from karim and login as user pi. Then execute this command:

pi@raspberrypi ~$ sudo adduser karim sudo

Logout and login as karim and things should go.

0

Login as pi.

Copy /etc/sudoers.d/010_pi-nopasswd as 011-karim-nopasswd. Edit that and change pi to karim. You will need to use sudo for that.

Logout.

Login as karim.

Test whether sudo works for you.

Later you can remove the 010_pi-nopasswd file to disable sudo for pi.

  • I have tried your suggestion, but the problem is not resolved yet!!!! is there any other suggestion ???? – Karim Dabbabi Dabbabi Dec 26 '18 at 10:56
  • Add your karim userid to the groups that pi is in. – Dougie Dec 26 '18 at 14:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.