Home / How to configure CentOS to accept LPD connections from Unix clients?

How to configure CentOS to accept LPD connections from Unix clients?

The cups-lpd package must be installed and set up in order to accept requests to print using the LPD protocol on port 515. (in addition to a properly configured CUPS system).

In all versions of CentOS, first install the cups-lpd package as follows.
 yum install cups-lpd

Depending on the CentOS version you are using, there are different ways to enable and configure the service.

CentOS 4, 6, and 6

Enable the service and restart xinetd. Edit /etc/xinetd.d/cups-lpd and change.
disable = yes
disable = no
Add the following to the file /etc/xinetd.d/cups-lpd, below the line server = /usr/libexec/cups/daemon/cups-lpd
server_args = -o document-format=application/octet-stream
Restart the xinetd service.
service xinetd restart
chkconfig xinetd on
Change /etc/cups/cupsd.conf as follows.
# Allow remote access
Port 631
Listen /var/run/cups/cups.sock
# Share local printers on the local network.
Browsing On
BrowseOrder allow,deny
BrowseAddress @LOCAL
DefaultAuthType Basic
<Location />
# Allow shared printing...
Order allow,deny
Allow @LOCAL
Restart CUPS as follows.
service cups restart

CentOS 7 and 8

After installing the cups-lpd package, configure systemd to start listening on the LPD socket (port 515).

 systemctl enable --now cups-lpd.socket
To enable CentOS to accept print jobs via LPD on port 515 and process them using CUPS, run the aforementioned command.
If you also require command-line options for cups-lpd, such as the ability to turn off the printing of job cover sheets, then follow these steps to expand the systemd unit configuration.
Create a directory named /etc/systemd/system/cups-lpd\@.service.d
Create a file named cups-lpd.conf
Add the following entries to the file.
ExecStart=-/usr/lib/cups/daemon/cups-lpd -o <option>=<value>

Reload the server as follows.

systemctl daemon-reload

Restart cups-lpd.

systemctl restart cups-lpd.socket

To add job-sheets=none to the cups-lpd command line, for instance.

# mkdir /etc/systemd/system/cups-lpd\@.service.d
# vi /etc/systemd/system/cups-lpd\@.service.d/cups-lpd.conf
# cat /etc/systemd/system/cups-lpd\@.service.d/cups-lpd.conf
ExecStart=-/usr/lib/cups/daemon/cups-lpd -o job-sheets=none
# systemctl daemon-reload
# systemctl restart cups-lpd.socket

Leave a Reply