More from the web

Wednesday, 7 October 2015

Join Linux to active directory domain and setup a samba share

1 ) As root install the following prerequisites
yum –y install nscd.x86_64 pam_krb5.x86_64 samba-winbind.x86_64

2) Run the authconfig-tui util  command
Configure Winbind as follows

Restart Services

/etc/init.d/winbind restart
/etc/init.d/nmbd restart
/etc/init.d/smbd restart

Now see if you can list the domain users and groups:
wbinfo -u # lists all the users in the domain
wbinfo -g # lists all the groups in the domain

And also check if winbind and nsswitch are correctly working:

getent passwd # should return a list with all users on the local system and from the active directory

getent group # should return a list with all groups and their members, both from the local system and the active directory.

Some names or groups are resolved with getent, but others are not

The range of your idmap parameter is not wide enough to encompass all the users or groups

idmap uid = 16777216-33554431

idmap gid = 16777216-33554431

Create Windows share using Samba On Linux
1) Create directory to be shared

 2) Edit the samba configuration file  (keep a backup)
     vi /etc/samba/smb.conf

3) Create share

4) Save and restart the smb service
#service smb restart

You should now see the share appear while browsing the network

Entering line "chcon -t samba_share_t /path" can help with permission errors on the shared folder