Linux – Sudo Access for Active Directory Groups

active-directorylinuxsssdsudo

I have my Linux machine connected to AD but I am unable to get sudo privileges. I can sign on using AD credentials, but sudo doesn't work.

I have looked at everything I can find and everyone says to add the following to the sudoers file:

%MYDOMAIN\mygroup ALL=(ALL)ALL

When I do this and try to sudo it responds:

myusername is not in the suoders file. This incident will be reported.

Might the problem be that the AD domain/group is not listed in the group or passwd file? If so, how can I add it?

Best Answer

https://unix.stackexchange.com/questions/150476/allow-ad-groups-to-sudo may help:

winbind and sssd import the AD groups in an equivalent manner to NIS netgroups. So your group definitions in the /etc/sudoers file need to start with + and not %. Furthermore, names containing spaces should either be double-quoted, or each space specified as \x20.

%sudo              ALL = (ALL) ALL
+"domain users"    ALL = (ALL) ALL
+domain\x20admins  ALL = (ALL) NOPASSWD: ALL