0

I am in the root group of a suse machine but when I use

sudo -u <myAccount> ...

I get a

Root privileges are required for...

a few terminal commands:

$ cat /etc/sudoers:
ALL ALL=(ALL) ALL
root = ALL(ALL) ALL

$grep root /etc/group:
root:x:0:<myAccount>

$ grep x:0 /etc/passwd:
root:x:0:0:root:/root:/bin/bash

$ getent passwd | cut -d : -f 1 | xargs groups    
<myAccount> : users root

I don't know, am I missing something? I can't use the "real" root password as I am not privileged here.

1

AFAIK sudoers usually belong to the 'wheel' group.

I think adding you user to the 'wheel' group with

gpasswd -a $username wheel

and adding either

%wheel ALL=(ALL) ALL

or

%wheel ALL=(ALL) NOPASSWD: ALL

to your /etc/sudoers file, depending on wheter or not you want password authentication for sudo, should solve your problem.

IF you want the 'root' group to have sudo previliges, I think you should add

%root ALL=(ALL) ALL

notice the '%' prefix for groups.

  • Nice, the %root command worked for me. I still had the admin edit this with his root account but it works now like I wanted to. Thanks =) – Simons0n Nov 11 '14 at 12:00

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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