CentOS and Samba3x

While I am still working on Samba4 configuration, I had a task in my work to install new file server. I decided to do that using the latest CentOS distribution. Since 5.6 there is a new samba tree called Samba3x which has the latest or almost the latest version of Samba server.

First thing was to install the samba server, so

# yum install samba3x

After that we have the samba server installed.

The things which i have changed in smb.conf file (of course this is not the full smb.conf file!!):

workgroup = my_workgroup_name
server string = My Server Name %h
netbios name = Athena

security = user
passdb backend = tdbsam

[Homes]

comment = Home Directories
browsable = no
valid users = %S
writeable = yes
create mask = 0700
directory mask = 0700

[Share]

comment = My Shared Folder
path = /home/share
valid users = @my_group
force group = my_group
guest ok = no
create mask = 0600
directory mask = 0700
writeable = yes

[Public]

comment = Public Folder
path = /home/public
public = yes
writeable = yes
printable = no

That’s +/- my working smb.conf file.

The tricky part is the SELinux policies that we have to change.

First I have to enable home directories:

# setsebool -P samba_enable_home_dirs on

Next was to create directories and set proper rights to them:

# mkdir /home/public
# mkdir /home/share
# chown root:my_group /home/share
# chmod -R ug+rws,o-w,o+rx /home/share

And the SELinux policies:

# chcon -t samba_share_t /home/public
# chcon -t samba_share_t /home/share
# semanage fcontext -a -t samba_share_t ‘/home/share(/.*)?’
# restorecon -R -v /home/share

After that we can check Samba config

# chkconfig smb on

and run the Samba server service:

# /sbin/service/smb start

That’s all 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *