Samba (SMB) is an open source and free software suite that runs on Linux/UNIX based system but it also communicate with Windows client like a native application. It is a file sharing server. It is used to share files between Windows and Linux/UNIX systems. Samba is able to provide this service by employing the common Internet File System (CIFS). The heart of CIFS is the Server Message Block (SMB).
In this article I am going to explain how you can configure SAMBA server in Linux systems. Follow the below steps.
Step #1 . First you will need to create a directory where you want to keep data and share with other remote system such as Solaris,Windows, UNIX etc.
# mkdir /data
Step #2. Now you will need to install Samba server on system.
# yum install samba
$sudo apt-get install samba
Step #3. After installing samba server, configure it using it’s main configuration file “/etc/samba/smb.conf“.
# vim /etc/samba/smb.conf workgroup = windows-group. server string = Linux-Share [sharedfolder] comment = secured shared folder path = /srv/samba/data Valid users = sagar faeem guest ok = no writable = yes privatable = no browsable = yes
Save and exit
- Workgroup : Where this server belongs. When windows user try to access any network resource they first try to access my network place and then search for workgroup then to server.
- server string : Name of this samba server search, Here that name is Linux-Share.
- [sharedfolder] : Share name, When any users access samba server through network this will be visible as folder shared.
- comment : Use for any comment, which help to know what is this share for.
- path : Location of shared folder, this is used to specific which folder you want to share.
- valid users : Specifies which user is having access on this folder.
- writable : Privide the access control to user whether users are able to write or not. In this example they can read and write.
- privatable : It indecate whether this folder is private or not.
- browsable : It is used to specify whether the folder content is browsable or not.
Step #4. Now create password for the users. So that users can access this samba share remotely.
#smbpasswd -a sagar #smbpasswd -a faeem
Set the password for above users, password is stored in ” /etc/samba/smbpasswd ” file.
Step #5. Execute the below command for syntax check for smb.conf file.
Step #6. Now restart samba service.
# service smb restart
Step #7. Keep on samba service on during booting time, samba service will start if server restarted.
#chkconfig smb on
I hope this article will help to configure samba server on Linux/UNIX systems. If you have any queries and problem please comment in comment section.