How to Map AD groups to Samba share?


 
Thread Tools Search this Thread
Operating Systems Linux Red Hat How to Map AD groups to Samba share?
# 1  
Old 01-04-2013
How to Map AD groups to Samba share?

I am setup a samba share server which is authenticating from Active Directory.

I am able to access the share with AD user but not able to access when group defined in "valid users" parameters.

below are the steps i performed.

In smb.conf
Code:
[global]
workgroup = QASLABS
password server = WIN-60I6H2BG237.qaslabs.net
realm = QASLABS.NET
preferred master = no
security = ADS
idmap backend = ad
idmap uid = 100-20000000
idmap gid = 100-20000000
winbind separator = +
template shell = /bin/bash
winbind use default domain = true
winbind offline logon = false
preferred master = no
server string = Linux Test Machine
encrypt passwords = yes
log level = 3
log file = /var/log/samba/%m
max log size = 50
printcap name = cups
printing = cups
winbind enum users = yes
winbind enum groups = yes
winbind use default domain = yes
winbind nested groups = yes
netbios name = smbad
hosts allow = 127.0.0.1 192.16.17.0/24
passdb backend = tdbsam
template homedir = /home/%U
winbind nss info = rfc2307
 
[Data]
comment = Directory for storing Data
path= /opt/data
valid users = @NETWORK+itadmin NETWORK+testadmin
#valid users = @"QASLABS.NET\\itadmin"
writeable = yes
browseable=yes
create mask = 775
directory mask = 775
hosts allow = 127.0.0.1 192.16.17.0/24

In /etc/nsswitch.conf
Code:
passwd: files winbind
shadow: files winbind
group: files winbind
hosts: files dns wins
bootparams: nisplus [NOTFOUND=return] files
ethers: db files
netmasks: files
networks: files
protocols: db files
rpc: files
services: files
netgroup: files
publickey: nisplus
automount: files
aliases: files nisplus

On executing the wbinfo -u i am getting the user list from AD
Code:
[root@smbad ~]# wbinfo -u
administrator
guest
krbtgt
testdev
testadmin
testhr
testqa
testit
testcmt
testsupp
testituser

On executing the wbinfo -u i am getting the user list from AD. But groups i created on AD is not displaying in this list [i.e itadmin]
Code:
[root@smbad ~]# wbinfo -g
BUILTIN+administrators
BUILTIN+users
SMBAD+itadmin
domain computers
domain controllers
domain admins
domain users
domain guests
group policy creator owners
read-only domain controllers
dnsupdateproxy
cert publishers
ras and ias servers
allowed rodc password replication group
denied rodc password replication group
dnsadmins
schema admins
enterprise admins
enterprise read-only domain controllers

Please help on how to map AD group to samba so that group permissions can be setup on samba

Last edited by Scott; 01-16-2013 at 09:19 AM.. Reason: Code tags
# 2  
Old 01-07-2013
Any help on this will appreciate.
# 3  
Old 01-09-2013
After changing the parameters in /etc/smb.conf i am able to view users/groups i created on AD.

/etc/samba/smb.conf
Code:
workgroup = QASLABS
server string = Samba Server Version %v
password server = adserver.qaslabs.net
realm = QASLABS.NET
preferred master = no
security = ADS
;idmap backend = ad
idmap uid = 500-20000000
idmap gid = 500-20000000
winbind separator = +
template shell = /bin/bash
winbind use default domain = true
winbind offline logon = false
preferred master = no
encrypt passwords = yes
log level = 3
log file = /var/log/samba/%m
max log size = 50
printcap name = cups
printing = cups
winbind enum users = yes
winbind enum groups = yes
winbind use default domain = yes
winbind nested groups = yes
;netbios name = smbad
hosts allow = 127.0.0.1 192.16.17.0/24
passdb backend = tdbsam
template homedir = /home/%U
;winbind nss info = rfc2307

On executing the wbinfo i am able to view the AD users created by me.
Code:
[root@smbad samba]# wbinfo -u
administrator
guest
krbtgt
tlit
usrit
tladmin
usradmin
tlcmt
usrcmt
tldev
usrdev
tlhr
usrhr
tlqa
usrqa
tlsupp
usrsupp

and on executing the wbinfo with -g i am able to view the AD groups created by me.
Code:
[root@smbad samba]# wbinfo -g
BUILTIN+administrators
BUILTIN+users
domain computers
domain controllers
schema admins
enterprise admins
cert publishers
domain admins
domain users
domain guests
group policy creator owners
ras and ias servers
allowed rodc password replication group
denied rodc password replication group
read-only domain controllers
enterprise read-only domain controllers
dnsadmins
dnsupdateproxy
itadmin
ituser
admadmin
adminuser
cmtadmin
cmtuser
devadmin
devuser
hradmin
hruser
qaadmin
qauser
suppadmin
suppuser

I am also able to test the ad users with password
Code:
[root@smbad samba]# wbinfo -a tladmin%Password1
plaintext password authentication succeeded
challenge/response password authentication succeeded

But now the issue is when i am accessing the samba share using these usernames i am not able to login to share and below error is coming in logs file.
Code:
setting sec ctx (0, 0) - sec_ctx_stack_ndx = 1
[2013/01/10 02:04:28, 3] smbd/sec_ctx.c:pop_sec_ctx(356)
pop_sec_ctx (0, 0) - sec_ctx_stack_ndx = 0
[2013/01/10 02:04:28, 2] auth/auth.c:check_ntlm_password(319)
check_ntlm_password: Authentication for user [itusr] -> [itusr] FAILED with error NT_STATUS_NO_SUCH_USER
[2013/01/10 02:04:28, 3] smbd/error.c:error_packet_set(106)
error packet at smbd/sesssetup.c(105) cmd=115 (SMBsesssetupX) NT_STATUS_LOGON_FAILURE
[2013/01/10 02:04:28, 3] smbd/process.c:timeout_processing(1382)
timeout_processing: End of file from client (client has disconnected).
[2013/01/10 02:04:28, 3] smbd/sec_ctx.c:set_sec_ctx(241)
setting sec ctx (0, 0) - sec_ctx_stack_ndx = 0

Also on login to the AD user from putty it is not accepting passwords.
Code:
[admin@smbad ~]$ su tladmin
Password:
su: incorrect password

Where as on login to AD user from putty from root account i am able to login [Password not prompted from switching from root user to AD user]

Please help me on this.

Thanks in advance..

Last edited by Scott; 01-16-2013 at 09:21 AM.. Reason: Code tags
# 4  
Old 01-16-2013
I am able to solve this issue now and AD groups are reflected with samba permissions.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Mounting a samba share

Hi, I need to mount a directory from a Windows server to a CentOS box. The Windows server used is Windows Server 2003, and the path to the directory that I want to mount on CentOS is C:\Tomcat6\webapps\NASApp\logs. I am not sure of the correct way to mount this on CentOS, as most of the... (2 Replies)
Discussion started by: anaigini45
2 Replies

2. Ubuntu

Samba share on software raid1

Hello! i am having a ubuntu server with two empty disks and connected software raid1 to it. I am having /mnt/raid folder which i created to mount it. SO should i now make a share folder inside that or what? I ama bit confused when a raid is present. (27 Replies)
Discussion started by: tomislav91
27 Replies

3. Red Hat

Samba share - currently not working

Long running samba share. Never have any problems, Suddenly started asking windows users for password - which doesnt work. Tried to manually reset smb password and manually map - still wrong password. Restart samba? (2 Replies)
Discussion started by: psychocandy
2 Replies

4. Red Hat

NFS share and groups

I am having an issue with getting the proper group settings on NFS-shared directories. NFS server, NFServe, nfs-shares hundreds of project directories...running Solaris 10 latest patches/updates. SAS server, SAServe, statistical analysis server running on RedHat 7 with latest kernel/patches/etc.... (14 Replies)
Discussion started by: cjhilinski
14 Replies

5. Solaris

samba issue: one samba share without password prompting and the others with.

Hi All, I've been trying to configure samba on Solaris 10 to allow me to have one share that is open and writable to all users and have the rest of my shares password protected by a generic account. If I set my security to user, my secured shares work just fine and prompt accordingly, but when... (0 Replies)
Discussion started by: ideal2545
0 Replies

6. Windows & DOS: Issues & Discussions

Script to automatically map samba shares as network drive

Hopefully someone will be kind enough to help me. I have a fileserver acting as a PDC and providing samba shares to a small network. Authentication to the PDC is via LDAP (setup using ebox) The users all have real local accounts on the server. I would like a windows logon script that will:... (4 Replies)
Discussion started by: barrydocks
4 Replies

7. Linux

Auto map network drive using SAMBA with batch file

Hi everyone. I have several shares (see smb.conf below). Each setup fairly similarly, and several groups. My end goals are: 1) to have the share automatically map as the P: drive to members of the employees group 2) to have the share automatically map as the t: drive to members of the tech... (0 Replies)
Discussion started by: unassassinable
0 Replies

8. Linux

Samba share script

Hi everyone! I'm trying to run a script when a folder is shared and when it stop being shared. Is there something like .start_share or .stop_share scripts in Samba where I could run some commands?:confused: edit: maybe with a wrapper in smbmount but I share folders via nautilus. Any ideas? (0 Replies)
Discussion started by: funyotros
0 Replies

9. SuSE

Map AIX share

I need some assistance creating a mount to a share on an AIX system on a SuSe Linux box. I haven't had any luck using the Connect to Server option within the gui, so I am assuming I need to use the 'mount' command but need some assitance with the syntax if this is the right way to go. Any... (2 Replies)
Discussion started by: genesis211
2 Replies

10. UNIX for Dummies Questions & Answers

samba user.map file

I am using Samba 3.0.33. The user.map file is not referred anywhere is Smb.conf. Infact, I couldn't see the user.map file any where in samba. But everything seems to be working. Is there an alternative way to refer to the users list. (2 Replies)
Discussion started by: sagar_evc
2 Replies
Login or Register to Ask a Question