Home 0P3N Blog Create a SMB share on CentOS
Ready to Start Your Career?
Create Free Account
By: kent
December 8, 2016

Create a SMB share on CentOS

By: kent
December 8, 2016
By: kent
December 8, 2016
tessellation-greenDisable SELinuxFor the sake of simplicity and saving time, we will be disabling SELinux, which isn’t recommended. We urge you to learn how SELinux works and to set it up accordingly after getting samba working successfully.This will disable SELinux from being enabled on boot:vi /etc/selinux/configChange “SELINUX=enforcing” to “SELINUX=disabled”Run this to immediately disable SELinux without rebooting:setenforce 0Allows Samba Ports in IptablesChange 10.0.0.0/24 to the subnet you wish to allow access to your samba serverIptables -A INPUT -s 10.0.0.0/24 -p udp –dport 137 -j ACCEPTIptables -A INPUT -s 10.0.0.0/24 -p udp –dport 137 -j ACCEPTIptables -A INPUT -s 10.0.0.0/24 -p udp –dport 137 -j ACCEPTIptables -A INPUT -s 10.0.0.0/24 -p udp –dport 137 -j ACCEPTService iptables saveInstall Sambayum install samba samba-client samba-commonSet Samba to start on bootchkconfig smb onchkconfig nmb onCreate a samba useruseradd sambagroupadd sambagroupusermod -a -G sambagroup sambaCreate the share directorymkdir /home/samba/privateGive the share directory the correct permissionschown -R samba:sambagroup /home/samba/privatechmod -R 0770 /home/samba/privateBackup the default smb configmv /etc/samba/smb.conf /etc/samba/smb.conf.bakEdit the smb configvi /etc/samba/smb.confAdd the following and adjust how you see fit:[global]workgroup = WORKGROUPsecurity = sharemap to guest = bad user[Secure]path = /home/samba/privatevalid users = @sambagroupguest ok = nowritable = yesbrowsable = yesStart Sambaservice smb startservice nmb start
Request Demo

Build your Cybersecurity or IT Career

Accelerate in your role, earn new certifications, and develop cutting-edge skills using the fastest growing catalog in the industry