Kali Linux Printer Setup: Difference between revisions
mNo edit summary |
|||
Line 1: | Line 1: | ||
<noinclude><!--[[Category:Linux_Desktop|?]]-->{{ContentArticleHeader/Linux_Desktop}}</noinclude> | <noinclude><!--[[Category:Linux_Desktop|?]]-->{{ContentArticleHeader/Linux_Desktop}}</noinclude> | ||
In my case I was in need to setup my [https://support.hp.com/us-en/document/c00310427 HP 1022 printer] to work with Kali Linux. After the following setup it works great. In this guide are used the tools <code>cups</code>, <code>cups-client</code> and <code>foomatic-db</code>, which are not installed and enabled by default in Kali Linux. | In my case I was in need to setup my [https://support.hp.com/us-en/document/c00310427 HP 1022 printer] to work with Kali Linux. After the following setup it works great. In this guide are used the tools <code>cups</code>, <code>cups-client</code> and <code>foomatic-db</code>, which are not installed and enabled by default in Kali Linux. | ||
[https://openprinting.github.io/cups/ 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 [https://github.com/openprinting/cups-filters cups-filters] project provides additional filters and drivers. | |||
[https://github.com/OpenPrinting/foomatic-db 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 required Packages and Deal with the Permissions == | ||
Install the requited packages<syntaxhighlight lang="shell" line="1"> | Install the requited packages.<syntaxhighlight lang="shell" line="1"> | ||
sudo apt update | sudo apt update | ||
sudo apt install cups cups-client "foomatic-db" | sudo apt install cups cups-client "foomatic-db" | ||
Line 9: | Line 13: | ||
sudo adduser root lpadmin | sudo adduser root lpadmin | ||
sudo adduser $USER lpadmin | sudo adduser $USER lpadmin | ||
</syntaxhighlight>Enable and start | </syntaxhighlight>Enable and start CUPS service.<syntaxhighlight lang="shell" line="1"> | ||
sudo systemctl enable --now cups.socket | sudo systemctl enable --now cups.socket | ||
sudo systemctl enable --now cups.service | sudo systemctl enable --now cups.service | ||
</syntaxhighlight>Restart | </syntaxhighlight>Restart CUPS and Samba services.<syntaxhighlight lang="shell" line="1"> | ||
sudo systemctl restart cups.service | sudo systemctl restart cups.service | ||
sudo systemctl restart smbd.service | sudo systemctl restart smbd.service | ||
Line 31: | Line 35: | ||
tcp6 0 0 ::1:631 :::* LISTEN 1217/cupsd | tcp6 0 0 ::1:631 :::* LISTEN 1217/cupsd | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== 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 {{Media-cite|f|1}}. | |||
== References == | == References == | ||
Line 37: | Line 44: | ||
* Local copy of the above resource: [[:File:How to install and configure printers on Linux (cups and foomatic-db) by BlackMoreOps.pdf|How to install and configure printers on Linux (cups and foomatic-db).pdf]] | * Local copy of the above resource: [[:File:How to install and configure printers on Linux (cups and foomatic-db) by BlackMoreOps.pdf|How to install and configure printers on Linux (cups and foomatic-db).pdf]] | ||
* OpenPrinting CUPS: [https://openprinting.github.io/cups/ CUPS Home Page] | |||
<noinclude> | <noinclude> |
Revision as of 12:37, 19 August 2022
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.
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