Build a Samba Server on Redhat / CentOS
Monday, 26 July 2010 18:36

Below shows you the basic steps in order to configure your Linux Redhat / CentOS server as a Samba server.

Install and Configure

yum install samba -y
chkconfig --level 123 smb on 
cd /etc/samba
mv smb.conf smb.conf.backup
vi smb.conf
cat > /etc/samba/smb.conf 
[paste the text below]
# Global parameters

[global]
workgroup = Workgroup
netbios name = SambaServerserver string = Samba Server %v
log file = /var/log/samba/log.%m
encrypt passwords = yes
max log size = 50

[data]
path = /data
valid users = smbuser
read only = No

Configure Users

adduser smbuser 
 passwd smbuser 
 smbpasswd -a smbuser [enter the same password as your smbuser unix account]

Restart Samba

/etc/init.d/smb restart

Map Drive

You can now map your drive with the windows command prompt using the command :

C:\Users\admin>net use * \\[SAMBA SERVER IP]\data /user:smbuser [password] /PERSISTENT:YES

Troubleshooting

To see if the share is available you can run the following command :

[root@SambaServer ~]# smbclient -U smbuser -L //[SAMBA SERVER IP]
Password:
Domain=[FILESERVER] OS=[Unix] Server=[Samba 3.0.33-3.29.el5_5]

        Sharename       Type      Comment
        ---------       ----      -------
       <strong> data        Disk</strong>
        IPC$            IPC       IPC Service (Samba Server 3.0.33-3.29.el5_5)
Domain=[FILESERVER] OS=[Unix] Server=[Samba 3.0.33-3.29.el5_5]



 
We have 54 guests online