Samba is a SMB/CIFS networking protocol is used for providing file and print services for Microsoft clients. Samba also can be used as part of Active Directory domain. Samba uses TCP/IP protocol for communication.
I am using CentOS 6.3 for below installation instructions, But below steps will also work on CentOS 5 as well.
Step 1: Installing Samba using Yum.
# yum install samba
Loaded plugins: fastestmirror, refresh-packagekit, security Loading mirror speeds from cached hostfile * base: ftp.iitm.ac.in * epel: mirrors.ustc.edu.cn * extras: ftp.iitm.ac.in * updates: ftp.iitm.ac.in Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package samba.i686 0:3.6.9-151.el6 will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: samba i686 3.6.9-151.el6 base 5.1 M Transaction Summary ================================================================================ Install 1 Package(s) Total download size: 5.1 M Installed size: 18 M Is this ok [y/N]: y Downloading Packages: samba-3.6.9-151.el6.i686.rpm | 5.1 MB 00:18 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : samba-3.6.9-151.el6.i686 1/1 Installed: samba.i686 0:3.6.9-151.el6 Complete!
Step 2: Create an account for Authentication
Now create a system account for authentication to access samba shares.
# useradd marc # passwd marc
Also add this account in smbpasswd file to be used by samba authentication.
# smbpasswd -a marc
Step 3: Configure Samba to Share Directory
Now you will required a directory to be access with samba.
# mkdir /opt/shared
Add below entry in Samba configuration file /etc/samba/smb.conf at the bottom.
[publicshare] comment = Public Stuff path = /opt/shared public = yes writable = yes valid users = marc write list = marc
Step 4: Restart Samba Service
Restart smb and nmb services of your system.
# /etc/init.d/smb restart # /etc/init.d/nmb restart
Step 5: Verify Setup
To test your setup, you need to access shared location from windows system. Go to run windows and type below.
Change ip with your system ip. If will prompt for authentication. To authorize use account created in #2.