Wednesday, 22 August 2012

How to set up a print server on Ubuntu 12.04 LTS using Samba


First thing is to install the packages we need – Samba and smbfs. So open up a terminal and type:
sudo apt-get install samba
Type your root password when prompted.  Then install smbfs by typing:
sudo apt-get install smbfs
and then type your root password again.
We now have to configure the smb.conf file which contains all the samba settings. In a terminal type:
sudo nano /etc/samba/smb.conf
Locate the line WORKROUP = WORKGROUP and change it to the name of your network.  So for instance mine would be changed to WORKGROUP = Ubuntu_home.
Save the file and exit.
We now need to restart the samba service so in a terminal type:
sudo service smbd restart
Now we have to check the configuration so far.  In a terminal type:
testparm
If everything is configured correctly then you shouldn’t receive any error messages and your server is ready to go.
Linux Clients
Install samba and smbfs either using the package manager or the terminal.  We need to edit the Workgroup field in smb.conf to the name of your network (e.g Ubuntu_home). Restart the samba service and install your printer.
Windows Clients
We have to change the workgroup to Ubuntu_home and then add your printer.


[Edit] My printers config. Remembering that samba is 3.6.3 in ubuntu 12.04
load printers = yes[printers]
comment = All Printers
browseable = yes
path = /var/spool/samba
printable = yes
guest ok = yesreadonly = yes
create mask = 0700
[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
browseable = yesreadonly = yes
guest ok = yes
With this config I can't install the remote printer using Samba or from a Windows machine
f you want to use nopassword to samba you need either edit your samba config file and set guest share to look like this: edit samba config:
gedit /etc/samba/smb.conf 
[Guest Share]
        comment = Guest access share
        path = /path/to/dir/to/share
        browseable = yes
        read only = yes
        guest ok = yes

1 comment: