Configure Samba CentOS 6
Configure Samba CentOS 6

Recently Samba, but more accurately Microsoft deprecated the samba ‘share’ mode. This is quite disappointng, quite a bit of systems are configured to work this way. However this solution should work from an Enterprise standpiont, at least until samba4 is needed.
Client LDAP Authentication:
The first thing you want to do is configure your hopefully very few Windows Desktops/Servers to use LDAP authentication. The reason you want to do this, is the samba configuration is dependant on you sending the username and password that matches your credentails. You could do this with local accounts, however it will not work after a password chagne takes place, so in order to sync LDAP/Samba to use the same username and password, this process is necessary.
Configure pGina for LDAP Authentication
Configure Samba:


edit the samba config file

add the following:
# Revised Samba Config 3/16/2016
workgroup = YOURDOMAIN
security = user
map to guest = Bad User
passdb backend = tdbsam
# Allow SymLinks
follow symlinks = yes
wide links = yes
unix extensions = no
#============= Share Definitions ====================
[Finance]
path = /some/path/Finance
writable = yes
public = yes
create mode = 0660
directory mode = 0770
force user = %U
hosts allow = 192.168.1.100 192.168.1.101
You can optionally specify the hosts to allow for extra locked down shares.
The key part is the force user = %U this effectively sends the username you are logged in with. As a result if it matches what you have in LDAP (it should using the pGina method) you will be able to access the same shares in the same way via samba or NFS.
restart samba once the config is applied.

That’s it, you have successfully configured Samba on CentOS 6!
Hosted Linux servers at www.zwiegnet.com/go
