Set up a network printer using SMB

From LQWiki
Jump to: navigation, search

This article describes how you can set up a network printer using Samba. Let's imagine you have two Unix boxes and want to share your printer on the server, let's call it server, to the client client. The most basic setup is posted here.

  • install Samba on the server and the client
  • on the server, modify /etc/samba/smb.conf:
[printers]
        comment = All Printers
        path = /var/tmp
        printable = Yes
        create mask = 0600
        browseable = No
        public = Yes
  • on the server, check your configuration:
testparm
  • on the server, start Samba:
/etc/init.d/smb start
  • on the client, look for a connection to the server:
$ smbclient -L server
Password:
...
        Sharename       Type      Comment
        ---------       ----      -------
...
       printer         Printer   printer
...

If that does not work as expected, look that your firewall is down on the server.

  • on the client, set up your printer by means of your distribution, e.g. for SUSE:
yast2 printer