User Tools

Site Tools


samba:print-server

Setting up a Print Server

A Samba print server is basically a member server that shares printers in addition to files. Any member server can be set up to be a print server. Because I use very small KVM domains (read Virtual Machines) and for redundancy purposes, I prefer to use an additional machine to do the printing.

A good name for a print server is PS1

Install and configure a new member server for printing

First things first: A print server is a Member server.

  • Then please configure as a member server, but do not add the example shares in the Member Server article to smb.conf
  • Add printing options to smb.conf, and declare print spool and printer driver's shares. This options will pass to Samba any printer configured in CUPS, and prepare the system to serve Windows (64 bit) drivers
# Printing options in [global] section of smb.conf
      printing = CUPS
      spoolss: architecture = Windows x64
      load printers = yes
      
[printers]
     path = /var/tmp/
     printable = yes
     
[print$]
     path = /var/lib/samba/printer_drivers/
     read only = no

Grant SePrintOperatorPrivilege

This is needed to manage printers from Windows.

See granting privileges

Install and configure CUPS printing scheduler

  • Install CUPS binaries:
 apt-get update && apt-get install --no-install-recommends cups
  • Configure CUPS /etc/cups/cupsd.conf by modify the following lines :
# Listen for connections from on port 631
# Listen localhost:631
Listen /run/cups/cups.sock
Port 631

# (DO not) Show other shared printers on the local network.
Browsing No
BrowseLocalProtocols dnssd

# Default authentication type, when authentication is required...
DefaultAuthType Basic

# Web interface setting...
WebInterface Yes

# Timeout after cupsd exits if idle (applied only if cupsd runs on-demand - with -l)
IdleExitTimeout 60

# Restrict access to the server...
# Allow samba to talk to cups (localhost and 127.0.0.1), else, ask for password.
<Location />
    Order allow,deny
    Allow from 127.0.0.1
    Allow from localhost
    # If you want password-less access from your LAN to the CUPS interface,
    # then uncomment the following line: 
    # Allow from 192.168.0.0/24
    AuthType Default
    Require valid-user
    Satisfy any
</Location>

Please note, if you ever need to replace / rebuild your printer server, all CUPS configurations are in /etc/cups/cupsd.conf and /etc/cups/printers.conf. These can be copied to the new server and it will be ready to run with same config.

Add a printer(s) to CUPS

Please note this is beyond the scope of this article, but it should be pretty straight forward from the CUPS web interface, it should be at http://ip-of-your-printserve:631

Also be aware there is no need to install any driver in CUPS for Windows printing, just use “raw” driver when asked. Windows clients will have their own drivers.

Once the printer has been added to CUPS, it will show on the shares resources of the print server when you access \\PS1

Configure the print server for Automatic Windows Driver download.

You can now continue to setting up automatic driver download for Windows clients.


Caponato's Samba notebook. Start here or else Main menu

samba/print-server.txt · Last modified: 2023/10/28 11:24 by caponato