Comments on CentOS 6.2 Samba Standalone Server With tdbsam Backend
CentOS 6.2 Samba Standalone Server With tdbsam Backend This tutorial explains the installation of a Samba fileserver on CentOS 6.2 and how to configure it to share files over the SMB protocol as well as how to add users. Samba is configured as a standalone server, not as a domain controller. In the resulting setup, every user has his own home directory accessible via the SMB protocol and all users have a shared directory with read-/write access.
3 Comment(s)
Comments
CentOS creates a group with the same name as the user (unless over-written). This is useful to give supervisory access. We can use the technique to create groups. When using this strategy, the smb.conf file doesn't have to be modified when creating group filespace.
For example, say you have users Tom and Harry. They are both part of the sales group. Suppose Tom is the manager and is allowed access to Harry's filespace.
Creating the users as normal:
useradd tom -m
useradd harry -m
Then creating the group is as simple as:
useradd sales -m
To append the sales space to Tom's list of groups:
usermod -a -G sales tom
Similarly, to give Harry access:
usermod -a -G sales harry
To give Tom access to Harry's filespace:
usermod -a -G harry tom
You would, of course, need to add the valid users (with %S), force group (with %S), create mask and directory mask stuff to the [homes] section.
I add a few items to hide dot files:
hide dot files = yes
veto files = /.*/
delete veto files = no
Also, I've had some creation rights issues that are resolved with:
force create mode = 660
force directory mode = 770
I couldn'd map Windows network drives to Samba shares until I added some ports to the firewall exceptions...
# nano /etc/sysconfig/iptables (I use nano instead of vi)
...add the following to the list:
-A INPUT -m state --state NEW -m tcp -p tcp --dport 137 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 138 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 139 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 445 -j ACCEPT
...then restart the firewall service
# service iptables restart
...then mapping to Samba shares from Windows was a breeze.
Thanks for the walkthrough!
I have some small problems after following this tutor:
I able to access the shared folder fine, but any new folders files copied to there cannot view the files only new directories. any tip o this.
I have no rproblem with ubuntu setup, but I like to get this work on CENTOS.
thanks