Just some notes I took when installing SAMBA on CentOS 6.x. for a development environment. DO NOT use this setup for any sort of production system, this appropriate for development only. I run CentOS VMs on my Windows 7 box for development work and I like to map my home directory for each to Windows for ease of access and editing of files.
Turn off SELinux
Set the following:
Turn off IPTables
chkconfig iptables off
Restart the Machine
shutdown -r now
yum install samba samba-client
Update Configuration File
Edit the network section
[global] # ----------------------- Network Related Options ------------------------- # # workgroup = NT-Domain-Name or Workgroup-Name, eg: MIDEARTH # # server string is the equivalent of the NT Description field # # netbios name can be used to specify a server name not tied to the hostname # # Interfaces lets you configure Samba to use multiple interfaces # If you have multiple network interfaces then you can list the ones # you want to listen on (never omit localhost) # # Hosts Allow/Hosts Deny lets you restrict who can connect, and you can # specifiy it as a per share option as well # workgroup = server string = Samba Server Version %v #netbios name = SERVER ; interfaces = lo eth0 192.168.12.2/24 192.168.13.2/24 interfaces = lo eth0 ; hosts allow = 127. 192.168.12. 192.168.13. ; hosts allow = 127. 192. 10.
Create a section for your share
#============================ Share Definitions ============================== [homes] comment = Home Directories browseable = yes writable = yes ; valid users = %S ; valid users = MYDOMAIN\%S [swright] path=/home/swright writeable=yes browseable=yes valid users=swright
Set your SAMBA password
I usually just make this the same password as my Linux user account
smbpasswd -a swright
Restart the SAMBA Services
service smb restart
service nmb restart
Test the Config File
You should see something like:
[root@localhost ~]# testparm Load smb config files from /etc/samba/smb.conf rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384) Processing section "[homes]" Processing section "[printers]" Processing section "[swright]" Loaded services file OK. Server role: ROLE_STANDALONE Press enter to see a dump of your service definitions [global] workgroup = WORKGROUP server string = Samba Server Version %v interfaces = lo, eth0 log file = /var/log/samba/log.%m max log size = 50 idmap config * : backend = tdb cups options = raw [homes] comment = Home Directories read only = No [printers] comment = All Printers path = /var/spool/samba printable = Yes print ok = Yes browseable = No [swright] path = /home/swright valid users = swright read only = No
One big issue that I run into is due to some conflicts with Network Manager in CentOS 6. NMB will try to start before the network is ready and so fails. Here is a thread about it: http://forums.fedoraforum.org/archive/index.php/t-290347.html
I just shut off the Network Manager using the GUI. I am sure there is a better way to do it though. Will post later.