LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-05-2015, 09:11 AM   #1
whositwhatnow
Member
 
Registered: Mar 2012
Distribution: RHEL 5/6
Posts: 56

Rep: Reputation: Disabled
Question Sudoers and Active Directory issues


Hello,

I've recently setup a test box to authenticate to our AD servers. That works no issues, but i want to add an AD group to the sudoers file. I've followed the following example:

Adding entries to /etc/sudoers

Adding the following entry to /etc/sudoers would allow you to give full sudo permissions to an AD group named ITadmins:

%DOMAIN\\ITadmins ALL=(ALL) ALL
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:

%DOMAIN\\Group\ Name\ With\ Spaces ALL=(ALL) ALL

Im running RHEL 6.6, I can get correct info from AD, but i cannot sudo with a valid user in a specified group. I need to be able to add different groups for access to different servers.

Any help would be great
 
Old 01-05-2015, 06:48 PM   #2
grantd1987
LQ Newbie
 
Registered: Jan 2015
Posts: 27

Rep: Reputation: Disabled
Hi there.

We recently did this and let's assume the following:

domain is Example.com
netbios name EX
group is Domain Admins

since we were only using a single domain, we just added:

%domain\ admins ALL=(ALL) ALL

But you might get it to also work as:

%example.com\\domain\ admins ALL=(ALL) ALL
%ex\\domain\ admins ALL=(ALL) ALL


I did notice that the AD Groups showed up as all lowercase for us, when in AD, they are mixed case
 
Old 01-05-2015, 08:24 PM   #3
whositwhatnow
Member
 
Registered: Mar 2012
Distribution: RHEL 5/6
Posts: 56

Original Poster
Rep: Reputation: Disabled
thanks grantd1987, i'm gonna try out yoru suggestions, will follow up with outputs.

oh forgot to mention im just authenticating with AD using kerberos

Last edited by whositwhatnow; 01-05-2015 at 08:25 PM.
 
Old 01-06-2015, 10:01 AM   #4
grantd1987
LQ Newbie
 
Registered: Jan 2015
Posts: 27

Rep: Reputation: Disabled
We are using kerberos as well
 
Old 01-06-2015, 10:32 AM   #5
whositwhatnow
Member
 
Registered: Mar 2012
Distribution: RHEL 5/6
Posts: 56

Original Poster
Rep: Reputation: Disabled
So followed both syntaxes and no go the users in the group are getting error user is not in sudoers file.
 
Old 01-06-2015, 02:53 PM   #6
grantd1987
LQ Newbie
 
Registered: Jan 2015
Posts: 27

Rep: Reputation: Disabled
If you type "groups" when logged in, do you see the list of AD groups associated with that account?
 
Old 01-06-2015, 03:17 PM   #7
whositwhatnow
Member
 
Registered: Mar 2012
Distribution: RHEL 5/6
Posts: 56

Original Poster
Rep: Reputation: Disabled
no ad groups at all
 
Old 01-06-2015, 03:19 PM   #8
grantd1987
LQ Newbie
 
Registered: Jan 2015
Posts: 27

Rep: Reputation: Disabled
Okay. That could be the difference. Let me pull the config/setup off our server and generalize it and post it here. That might help.
 
Old 01-06-2015, 07:24 PM   #9
grantd1987
LQ Newbie
 
Registered: Jan 2015
Posts: 27

Rep: Reputation: Disabled
Okay, after a quick collaboration, this is how we set it up

yum -y install authconfig krb5-workstation pam_krb5 samba-common oddjob-mkhomedir sudo ntp

authconfig --disablecache --enablewinbind --enablewinbindauth --smbsecurity=ads --smbworkgroup=UOI --smbrealm=EXAMPLE.COM --enablewinbindusedefaultdomain --winbindtemplatehomedir=/home/example.com/%U --winbindtemplateshell=/bin/bash --enablekrb5 --krb5realm=EXAMPLE.COM --enablekrb5kdcdns --enablekrb5realmdns --enablelocauthorize --enablemkhomedir --enablepamaccess --updateall

/etc/init.d/winbind stop

vi /etc/krb5.conf
[logging]
default = FILE:/var/log/krb5libs.log
kdc = FILE:/var/log/krb5kdc.log
admin_server = FILE:/var/log/kadmind.log

[libdefaults]
default_realm = EXAMPLE.COM
dns_lookup_realm = true
dns_lookup_kdc = true
ticket_lifetime = 24h
renew_lifetime = 7d
forwardable = true

[realms]

EXAMPLE.COM = {
kdc = ldap.example.com
admin_server = ldap.example.com
kdc = ldap.example.com
}

example.com = {
}

[domain_realm]
example.com = EXAMPLE.COM
.example.com = EXAMPLE.COM
authconfig-tui

The next is ASCII text of the screens followed by the buttons selected


┌────────────────┤ Authentication Configuration ├─────────────────┐
│ │
│ User Information Authentication │
│ [ ] Cache Information [ ] Use MD5 Passwords │
│ [ ] Use LDAP[*] Use Shadow Passwords │
│ [ ] Use NIS [ ] Use LDAP Authentication │
│ [ ] Use IPAv2[*] Use Kerberos │
│[*] Use Winbind [ ] Use Fingerprint reader │
│[*] Use Winbind Authentication │
│[*] Local authorization is sufficient |
│ │
│ ┌────────┐ ┌──────┐ │
│ │ Cancel │ │ Next │ │
│ └────────┘ └──────┘ │
│ │
│ │
└─────────────────────────────────────────────────────────────────┘

Select "Next"



┌─────────────────┤ Kerberos Settings ├──────────────────┐
│ │
│ Realm: EXAMPLE.COM_____________________________ │
│ KDC: dc1.example.com,dc2.example.com_________ │
│ Admin Server: dc1.example.com_________________________ │
│[*] Use DNS to resolve hosts to realms │
│[*] Use DNS to locate KDCs for realms │
│ │
│ ┌──────┐ ┌──────┐ │
│ │ Back │ │ Next │ │
│ └──────┘ └──────┘ │
│ │
│ │
└────────────────────────────────────────────────────────┘

Select "Next"




┌─────────────────────┤ Winbind Settings ├─────────────────────┐
│ │
│ Security Model: (*) ads │
│ ( ) domain │
│ Domain: EX______________________________________ │
│ Domain Controllers: ________________________________________ │
│ ADS Realm: EXAMPLE.COM_____________________________ │
│ Template Shell: ( ) /sbin/nologin │
│ ( ) /bin/sh │
│ (*) /bin/bash │
│ ( ) /bin/ksh │
│ │
│ ┌──────┐ ┌─────────────┐ ┌────┐ │
│ │ Back │ │ Join Domain │ │ Ok │ │
│ └──────┘ └─────────────┘ └────┘ │
│ │
│ │
└──────────────────────────────────────────────────────────────┘

Select "Join Domain"
Select "Ok"


/etc/init.d/winbind restart​
 
1 members found this post helpful.
Old 01-07-2015, 08:34 AM   #10
whositwhatnow
Member
 
Registered: Mar 2012
Distribution: RHEL 5/6
Posts: 56

Original Poster
Rep: Reputation: Disabled
thanks for this, I wasnt using windbind, im wondering if that was the issue.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] RHEL 6 / Active Directory 2008 R2 issues brooky9999 Red Hat 10 11-26-2012 01:45 AM
Fedora /etc/sudoers file and sudoers.d directory davejjj Linux - Newbie 2 10-21-2011 06:19 PM
Active Directory and sudoers sparrow3 Linux - Server 1 08-30-2011 08:17 PM
Username & Password Sync Fedora Directory and Microsoft Active Directory karnac01 Fedora 4 07-19-2010 12:51 AM
Samba / Active Directory Issues ender13 Linux - Networking 1 09-29-2006 04:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration