0

I switched from the arch Linux image to the latest Debian Jessie lite 2017-01-11 image and added a new user as root.

# adduser sampletext

Then I added on the sudoers-file a new line with: sampletext ALL = (ALL) NOPASSWD: ALL

Then running runuser -l sampletext I get

>>>/etc/sudoers: syntax error near line 28 <<<
sudo: parse error in /etc/sudoers near line 28
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin

The same error also displays when I try sudo on the pi account.

I noticed that the pi-user wasn't present when I first opened the sudoers-file even though I did sudo su on it.

Is there a way to add another user with the same privileges as the pi-user?

  • 1
    The first conclusion I draw is there is a syntax error near line 28. The second conclusion is that you introduced the syntax error during your edit. – joan Jan 22 '17 at 10:18
  • @joan but the same thing worked before on older rasbian versions and arch. But for some reason the pi-user wasn't present in the file – Patently Paul Jan 22 '17 at 10:20
  • To add to what Joan and Millways have said it also does not appear that you used visudo edit the file which checks for syntax errors before saving and is the recommended way to edit the sudoers file. – Steve Robillard Jan 22 '17 at 10:40
  • it should be sampletext ALL=NOPASSWD: ALL – Rui F Ribeiro Jan 22 '17 at 12:23
1

What do you mean by "added a new user as root". There is already a root user, although as normally on Debian it does not have a password, so cannot logon.

It is inadvisable to fiddle with /etc/sudoers. Put everything back the way it was.

If you want to create a new user with the same privileges as pi set the user to be a member of the same groups, in particular of group sudo

  • I meant creating a user under root like root@pi~# adduser ... – Patently Paul Jan 22 '17 at 10:41
  • I removed the entry on the sudoers-file and added the new user to all the users pi is in. But when I try sudo sure I then get username is not in the sudoers file. This incident will be reported. – Patently Paul Jan 22 '17 at 10:43

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.