Kali Linux Printer Setup
In my case I was in need to setup my HP 1022 printer to work with Kali Linux. After the following setup it works great. In this guide are used the tools cups
, cups-client
and foomatic-db
, which are not installed and enabled by default in Kali Linux.
CUPS provides the System V ("lp") and Berkeley ("lpr") command-line interfaces, a configurable web interface, a C API, and common print filters, drivers, and backends for printing. The cups-filters project provides additional filters and drivers.
Foomatic Database is a collected knowledge about printers, drivers, and driver options in XML files, used by foomatic-db-engine to generate PPD files.
Install the required Packages and Deal with the Permissions
Install the requited packages.
sudo apt update
sudo apt install cups cups-client "foomatic-db"
The users will be added to the lpadmin
group automatically after installing the above packages, but we will do that manually just in case.
sudo adduser root lpadmin
sudo adduser $USER lpadmin
Enable and start CUPS service.
sudo systemctl enable --now cups.socket
sudo systemctl enable --now cups.service
Restart CUPS and Samba services.
sudo systemctl restart cups.service
sudo systemctl restart smbd.service
Find USB Printer
lsusb | grep 'HP'
Bus 001 Device 003: ID 03f0:2c17 HP, Inc LaserJet 1022
sudo netstat -pnat | grep 631
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1217/cupsd
tcp6 0 0 ::1:631 :::* LISTEN 1217/cupsd
Configure the Printer
There are two possible ways to configure the printer – via the web interface of CUPS or via the Gnome settings. I prefer the second method, illustrated at Figure 1. In both cases you need to use your user's credentials to administrate the printers.
To configure a printer via the web interface of CUPS navigate to the address http://127.0.0.1:631/admin within your browser, the go to the Administration section and click at the button Add Printer.
References
- BlackMoreOps.com: How to install and configure printers on Linux (cups and foomatic-db)?
- Local copy of the above resource: How to install and configure printers on Linux (cups and foomatic-db).pdf
- OpenPrinting CUPS: CUPS Home Page