skip to primary navigationskip to content
 

Linux Printing - Mott Network

SMB and CIFS are the Windows file and printer sharing protocols. We use Samba to speak to the Windows PCs using these protocols. Before configuring CUPS we should make sure we can connect to the Windows PC with smbclient, the Samba SMB/CIFS client Figure 2.

The following is an example of creating a connection to a Windows PC:

%user%@machine:~$ smbclient -L p1.mott.phy.private.cam.ac.uk -N

This should return something like:

Domain=[P1] OS=[Windows Server (R) 2008 Standard 6002 Service Pack 2] Server=[Windows Server (R) 2008 Standard 6.0]

        Sharename       Type      Comment
        ---------       ----      -------
        SP PS-COL-A4-D  Printer   SP PS-COL-A4-D

Domain=[P1] OS=[Windows Server (R) 2008 Standard 6002 Service Pack 2] Server=[Windows Server (R) 2008 Standard 6.0]

        Server               Comment
        ---------            -------

        Workgroup            Master
        ---------            -------

The command shown asks for a list of shares on a Windows PC named "p1", with no password given. The results show (amongst others) a printer named "SP PS-COL-A4-D".

If Windows Naming Service is unavailable you will need to specify the IP address of the Windows PC with the switch -I:

%user%@machine:~$ smbclient -I 172.24.108.175 -L p1 -N

For more information see the samba documentation about smbclient usage. Once you have found a Windows printer, you may configure CUPS. First verify that your installation of CUPS has the smb backend with the following command:

ls -l /usr/lib/cups/backend/smb

it should return something like:

/usr/lib/cups/backend/smb -> ../../../bin/smbspool

If this file does not exists, create it by issuing the following:

/usr/lib/cups/backend/smb -> ../../../bin/smbspool

The following is an example of setting up the printer shown above:

sudo lpadmin -p PS-COL-A4-D -v smb://p1/SP\ PS-COL-A4-D -P <PPD file>
enable PS-COL-A4-D
accept PS-COL-A4-D
lpadmin -d PS-COL-A4-D

If Windows naming service is unavailable, add the switch -h followed by the IP address of the Windows PC to the first lpadmin command:

sudo lpadmin -p PS-COL-A4-D -h 172.240108.175 -i smb://p1/SP\ PS-COL-A4-D -P <PPD file>

You will need to obtain a suitable PPD file for use with the printer you are trying to set up.

Printer Status

To check the status of the printers available from this server, you can visit the webpage http://p1.mott.phy.private.cam.ac.uk/printers/