I just joined an ubuntu 18.04 server to my windows domain. I want to add domain admins as sudoers on the ubuntu server. I created a file /etc/sudoers.d/domain_admins. I added %DOMAIN.COM\Domain\ Admins ALL=(ALL) ALL. When I tested a sudo command, with my domain admin, I got the message that it wasn't in the sudoers file. I checked the permissions on the file and noticed it was given 47. I did a chmod of 0440 but that did not seem to work as it's still set as 47. Any help would be appreciated.

  • I think that the appropriate syntax is %Domain\ Admins@DOMAIN.COM but don't quote me... (I'm assuming the AD group name is Domain Admins) – steeldriver Mar 24 at 15:24
  • I found this, though... Because a number of AD groups have spaces in the names, you’ll need to escape the spaces using backslashes. For example. adding the following entry to /etc/sudoers would allow you to give full sudo permissions to an AD group named Group Name With Spaces: 1 %DOMAIN\\Group\ Name\ With\ Spaces ALL=(ALL) ALL In both cases, replace DOMAIN with your AD domain’s name. – JordenD Mar 24 at 15:55
  • Sure - that may work as well, but note that you will need to escape both spaces and backslashes i.e. %DOMAIN.COM\\Domain\ Admins ALL=(ALL) ALL – steeldriver Mar 24 at 15:57
  • For some reason in the post, is not showing two backslashes, but they are there. lol – JordenD Mar 24 at 16:00

Got it figured out Just put this 'Domain\ Admins ALL=(ALL) ALL' without the ' '

| improve this answer | |

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.