Home > HowTo, Linux > How to setup Samba on CentOS

How to setup Samba on CentOS

December 28th, 2009 Leave a comment Go to comments

How to setup Samba on CentOS/RedHat etc…

Reference to older post (Debian)

Note: You can also login into to the server with
# ssh -X user@server
# yum install system-config-samba
# system-config-samba

Commands:
Login in the server as root and do:
# yum install samba
# adduser share
# smbpasswd -a share
# smbpasswd -a root
# chkconfig –list |grep smb
# chkconfig –level 345 smb on
# mv /etc/samba/smb.conf /etc/samba/smb.conf.bak

# cat <<EOF>/etc/samba/smb.conf
[global]
workgroup = MASTER
server string = %h Server Samba Version %v
interfaces =  eth0
log file = /var/log/samba/%m.log
max log size = 50
security = user
passdb backend = tdbsam
dns proxy = no
[logs]
comment = Read Only Logs Shared Folder
path = /usr/local/GlassFishESBv21/glassfish/domains/domain1/logs/
writeable = no
browsable = yes
locking = no
guest ok = yes
public = yes
valid users = share
[all]
comment =
path = /usr/local/
browseable = yes
guest ok = no
writable = yes
valid users =  root
EOF

# iptables-save > /etc/sysconfig/iptables
# vim /etc/sysconfig/iptables
-A RH-Firewall-1-INPUT -p udp -m state –state NEW -m udp –dport 137:139 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m state –state NEW -m tcp –dport 137:139 -j ACCEPT

# service iptables restart
# service smb restart
# smbclient -L  //LOCALHOST

From Windows test:
c:net use p: <servidor>logs share1 /user:share

Categories: HowTo, Linux Tags: , , , , , , ,

VAMOVE *

*