Installing Samba in Centos 6.5



Samba Server:
Operating system: CentOS 6.5
IP Address:

Samba Client
Operating system: Windows 7 Professional
IP Address:


1. Download package samba
# yum install samba samba-client samba-common

2. Configure servis samba supaya servis samba automatic start setiap kali kita restart server.
# chkconfig smb on
# chkconfig nmb on

3. Modify iptables
# iptables -I INPUT 4 -m state –state NEW -m udp -p udp –dport 137 -j ACCEPT
# iptables -I INPUT 5 -m state –state NEW -m udp -p udp –dport 138 -j ACCEPT
# iptables -I INPUT 6 -m state –state NEW -m tcp -p tcp –dport 139 -j ACCEPT
# service iptables save
# service iptables restart

4. Modify smb.conf. tp sebelum tu backup dulu file asal smb.conf
# cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
# rm /etc/samba/smb.conf
# touch /etc/samba/smb.conf
# nano /etc/samba/smb.conf

5. Sekarang modify smb.conf seperti di bawah
# nano /etc/samba/smb.conf
#======================= Global Settings =====================================
workgroup = WORKGROUP
security = share
map to guest = bad user
#============================ Share Definitions ==============================
path = /home/samba/share
browsable =yes
writable = yes
guest ok = yes
guest only = yes
create mode = 0777
directory mode = 0777
read only = no

6. Check the syntax error with testparm:
# testparm

7. Restart servis samba
# service smb restart
# service nmb restart

8. Disable SELinux
# nano /etc/sysconfig/selinux
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing – SELinux security policy is enforced.
# permissive – SELinux prints warnings instead of enforcing.
# disabled – No SELinux policy is loaded.
# SELINUXTYPE= can take one of these two values:
# targeted – Targeted processes are protected,
# mls – Multi Level Security protection.

You may need to reboot your machine.

9. Create directory untuk folder yang hendak di’share’ dan setkan permission 0777 untuk folder tersebut
# mkdir -p /home/samba/share
# chmod -R 0777 /home/samba/share

10. Create satu file di dalam folder sharing
# nano /home/samba/share/test.txt

Hello samba~!

save file

11. Sekarang boleh try access folder tersebut dari mesin Samba Client (windows)
start > run > \\                    —> adalah ip server samba

12. Kalau korang berjaya sepatutnya korang akan nampak folder sharing “MyShare” dan dalam tu akan ada file test.txt.

1. Restart network
# service network restart

2. Restart iptables
# service iptables restart

3. Restart samba
# service smb restart
# service nmb restart

4. Modify firewall config
# system-config-firewall-tui
Make sure firewall enable. Tanda [*] menunjukkan firewall dah enable. Kalau takde tanda [*] sila tekan spacebar untuk select dan enable firewall. Kemudian Pilih “Customize”, dan make sure tick kat “Samba” dan “Samba Client”. Then close dan save configuration firewall ni.

5. Reboot server
# reboot -h

6. Remove package samba then reinstall semula dan configure semula.
Remove samba
# rpm -qa | grep samba
# yum list installed | grep samba
# yum remove samba*

Now reinstall samba
# yum install samba* -y

The configure semula dari step 1.

Link 1
Link 2
Link 3

Thanks, wassalam..

This entry was posted in Install, Linux and tagged , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s