3

I want to give access domain admins group to sudoers access. I have come across with many commands but nun of works for me.

fname.lname ALL=(ALL) ALL

With this command i can give access to a particular user, But i want to give access to all the members of the domain admin group.

%DOMAINNAME\\domain\ admins ALL=(ALL) ALL
%DOMAINNAME\\domain\ admins ALL=(ALL) ALL
%DOM.DOMAINNAME.COM\\domain\ admins ALL=(ALL) ALL
DOMAINNAME\\domain\ admins ALL=(ALL) ALL
DOMAINNAME\\domain\ admins ALL=(ALL) ALL
DOM.DOMAINNAME.COM\\domain\ admins ALL=(ALL) ALL
%DOMAINNAME\\domain_admins ALL=(ALL) ALL

Like many commands i have tried but non out of these working.

My domain Group have two words i.e domain admins

Complete domain name is like: DOM.DOMAINNAME.COM

And short name is DOMAINNAME

Tell me how can i give access to sudoers for a group.

I am working on python scripting where it asks for sudo run but the user doesn't have sudo access or everytime no any domain user is entertain to enter credentials.

roaima
  • 107,089
  • 14
  • 139
  • 261
Rajat jain
  • 431
  • 1
  • 4
  • 9

1 Answers1

2

I have worked a lot on it, And after so many tries and searching I got this working

Type the command below and press Enter to safely open the /etc/sudoers file for editing:

$ sudo visudo

On a new line, insert the text below:

%domain\ admins ALL=(ALL) ALL

Since I was having DOMAIN name as two words I have to use: domain\ admins

domain admins

This was the exact group name I was having.

And % to specify group. and without % I would think it is take as username.

NO NEED TO SPECIFY DOMAIN That I was trying before. i.e:

%DOM.DOMAINNAME.COM\\domain\ admins ALL=(ALL) ALL
Arlen
  • 3
  • 1
Rajat jain
  • 431
  • 1
  • 4
  • 9
  • Sometimes it is necessary to use the domain prefix. It depends on the mechanism used to link to the external authenticator, `winbind` or `sssd`. You can see this in the flagged duplicate. – roaima Jan 21 '19 at 08:35
  • Oh i can see that. But in my case i have used `sssd` so it is working fine. – Rajat jain Jan 21 '19 at 10:01