Samba is a free software re-implementation of the SMB/CIFS networking protocol, provides file and print services for various Microsoft Windows clients and can integrate with a Windows Server domain. In the end of this tutorial you will be able to install and configure samba to as a print server.
A computer with CentOS 6.3 installed on it.
Computer with any version of widows installed on it.
For the sake of the simplicity of this tutorial you need to turn off the firewall and SELinux.
Step 1 : Install the service
The below commands by the order will install the service, run it and make it run in the startup
sudo yum install samba
sudo service smb start
sudo chkconfig smb on
Check that cupsd service is working (CUPS is currently the most widely used spool system in Unix / Linux environments) as below.
sudo service cups status
It should print the below
cupsd (pid 1926) is running...
Step 2 : Configure smb.conf
smb.conf is the configuration file for the samba program, you can configure the shares through this file. you will find this file in /etc/samba/ directory.
Now open this file with any text editor, in this example I will use the nano editor
sudo nano /etc/samba/smb.conf
change the printers section to mach below[Printers] comment = Printer Drivers
path = /var/lib/samba/drivers
browseable = yes
guest ok = yes
read only = no
Now restart the samba service
sudo service smb restart
Step 3 : Access the printer from windows machine
1- download the printer driver.
2- extract the exe file.
3- Open run and write the IP address of the server as below
4- Right click on the printer you want to install and choose connect.
5- You will be prompted to install the driver, select the proper driver in the extracted folder and click install.
Congrats, you can now print.