Back
Featured image of post Easy solution to how to fix CUPS unauthorized error

Easy solution to how to fix CUPS unauthorized error

An easy solution to CUPS unauthorized error an how to solve it in few clicks or bash commands.

Table of Content

Easy to fix solution to common Ubuntu printing CUPS error:

Cups error as: "Unauthorized"

This error usually happens because network connected printing device cannot authenticate you as a legit user. The most easiesy way to fix this error is being sure the password is still valid and you entered correctly.

Possible reasons to have this error

  • On a corporate environment, you entered the wrong username or password, and hence, domain connected printer cannot authenticate you.
  • You did not realize, buy your password expired.

Solution

The way it worker for me to fix this error is to execute the following command:

1
2
3
4
5
6
7
8
9
#!/bin/bash
echo "fixing CUPS error"
systemctl cups status

echo "stopping CUPS"
systemctl cups stop

echo "check content of cups config"
sudo nano /etc/cups/printers.conf

Make sure line DeviceURI smb:// has correctly setup your user and password. For example DeviceURI smb://jhon:p4ssw0rd@printer/id

And after that, always remember to restart!

1
2
#!/bin/bash
systemctl cups restart

cups.conf example file

As an example, I show you my current CUPS configuration file content.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# /etc/cups/printers.conf
# Printer configuration file for CUPS v1.7.2
# Written by cupsd
# DO NOT EDIT THIS FILE WHEN CUPSD IS RUNNING
<DefaultPrinter MyHomePrinter>
UUID urn:uuid: 4d336de3-c3f1-4566-b5d7-7a97af980658 
AuthInfoRequired username,password
Info My home printer
Location Home
DeviceURI smb://jhon:p4ssw0rd@printer/01
PPDTimeStamp *
State Idle
StateTime 1500452070
Type 8433692
Accepting Yes
Shared Yes
ColorManaged Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
OpPolicy default
ErrorPolicy retry-job
Option media 1
Option media-col media-bottom-margin
Option output-bin 0
Option print-color-mode color
Option print-quality 5
</Printer>

Conclusion

This is a simple solution that works in many cases, where the problem is just an authentication issue. Hope it works for you too.



💬 Share this post in social media

Thanks for checking this out and I hope you found the info useful! If you have any questions, don't hesitate to write me a comment below. And remember that if you like to see more content on, just let me know it and share this post with your colleges, co-workers, FFF, etc.

You are free to use the content, but mention the author (@MrSergioAnguita) and link the post!
Last updated on Oct 04, 2021 09:26 CEST
Please, don't try to hack this website servers. Guess why...