Kali Linux Printer Setup: Difference between revisions

From WikiMLT
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 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.
 
== 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="mlw-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>


== References ==
== References ==

Revision as of 12:58, 19 August 2022

In my case I was in need to set­up my HP 1022 print­er to work with Kali Lin­ux. Af­ter the fol­low­ing set­up it works great. In this guide are used the tools cups, cups-client and foomat­ic-db, which are not in­stalled and en­abled by de­fault in Kali Lin­ux.

In­stall the re­quired Pack­ages and Deal with the Per­mis­sions

In­stall the re­quit­ed pack­ages

sudo apt update
sudo apt install cups cups-client "foomatic-db"

The users will be added to the lpad­min group au­to­mat­i­cal­ly af­ter in­stalling the above pack­ages, but we will do that man­u­al­ly just in case.

sudo adduser root lpadmin
sudo adduser $USER lpadmin

En­able and start Cups ser­vice.

sudo systemctl enable --now cups.socket
sudo systemctl enable --now cups.service

Restart Cups and Sam­ba ser­vices.

sudo systemctl restart cups.service
sudo systemctl restart smbd.service

Find USB Print­er

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

Ref­er­ences