Kali Linux Printer Setup: Difference between revisions
m Стадий: 3 [Фаза:Разработване, Статус:Разработван]; Категория:Linux Desktop |
m Text replacement - "mlw-continue" to "code-continue" |
||
(10 intermediate revisions by the same user not shown) | |||
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. | |||
[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 requited packages.<syntaxhighlight lang="shell" line="1"> | |||
sudo apt update | |||
sudo apt install cups cups-client "foomatic-db" | |||
</syntaxhighlight>The users will be added to the <code>lpadmin</code> group automatically after installing the above packages, but we will do that manually just in case.<syntaxhighlight lang="shell" line="1"> | |||
sudo adduser root lpadmin | |||
sudo adduser $USER lpadmin | |||
</syntaxhighlight>Enable and start CUPS service.<syntaxhighlight lang="shell" line="1"> | |||
sudo systemctl enable --now cups.socket | |||
sudo systemctl enable --now cups.service | |||
</syntaxhighlight>Restart CUPS and Samba services.<syntaxhighlight lang="shell" line="1"> | |||
sudo systemctl restart cups.service | |||
sudo systemctl restart smbd.service | |||
</syntaxhighlight> | |||
== Find USB Printer == | |||
<syntaxhighlight lang="shell" line="1"> | |||
lsusb | grep 'HP' | |||
</syntaxhighlight> | |||
<syntaxhighlight lang="shell-session" class="code-continue"> | |||
Bus 001 Device 003: ID 03f0:2c17 HP, Inc LaserJet 1022 | |||
</syntaxhighlight> | |||
<syntaxhighlight lang="shell" line="1"> | |||
sudo netstat -pnat | grep 631 | |||
</syntaxhighlight> | |||
<syntaxhighlight lang="shell-session"> | |||
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1217/cupsd | |||
tcp6 0 0 ::1:631 :::* LISTEN 1217/cupsd | |||
</syntaxhighlight> | |||
{{Media | |||
| n = 1 | |||
| img = Gnome Settings Add a Printer.png | |||
| sz = 360 | |||
}} | |||
== 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}}. 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 http://127.0.0.1:631] within your browser, then go to the Administration section and click at the button Add Printer. | |||
== References == | == References == | ||
* ... | * BlackMoreOps.com: [https://www.blackmoreops.com/2013/11/15/install-configure-printers-linux-cups-foomatic-db/ How to install and configure printers on Linux (cups and foomatic-db)?] | ||
* 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> | ||
Line 13: | Line 58: | ||
{{devStage | {{devStage | ||
| Прндл = Linux Desktop | | Прндл = Linux Desktop | ||
| Стадий = | | Стадий = 6 | ||
| Фаза = | | Фаза = Утвърждаване | ||
| Статус = | | Статус = Утвърден | ||
| ИдтПт = Spas | | ИдтПт = Spas | ||
| РзбПт = {{REVISIONUSER}} | | РзбПт = Spas | ||
| АвтПт = Spas | |||
| УтвПт = {{REVISIONUSER}} | |||
| ИдтДт = 19.08.2022 | | ИдтДт = 19.08.2022 | ||
| РзбДт = {{Today}} | | РзбДт = 19.08.2022 | ||
| АвтДт = 19.08.2022 | |||
| УтвДт = {{Today}} | |||
| ИдтРв = [[Special:Permalink/30399|30399]] | | ИдтРв = [[Special:Permalink/30399|30399]] | ||
| РзбРв = {{REVISIONID}} | | РзбРв = [[Special:Permalink/30410|30410]] | ||
| АвтРв = [[Special:Permalink/30411|30411]] | |||
| УтвРв = {{REVISIONID}} | |||
}} | }} | ||
</div> | </div> | ||
</noinclude> | </noinclude> |
Latest revision as of 07:28, 26 September 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. 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 within your browser, then 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