PDA

View Full Version : [SOLVED] How to defeat CUPS restoring ...printers.conf when printing to a server printer



ChrisRChamberlain
March 18th, 2014, 05:19 PM
Hi all

Have a mixed LAN of Windows boxes, Ubuntu 12.04 server and now a Ubuntu 13.10 desktop.

There are 2 printers attached to the Ubuntu 12.04 server, serving the network, and installed on the Ubuntu 13.10 desktop.

Having stopped CUPS, /etc/cups/printers.conf is edited by modifying the 'AuthInfoRequired' line to be 'AuthInfoRequired None', and CUPS restarted.

Attempt to print to an installed server printer and the previously saved /etc/cups/printers.conf is reverted to its original state, forcing the 'Authentication...' dialog.

Entering username/password simply puts you in a never ending loop without anything being printed.

So what's missing, please?

TIA

volkswagner
March 18th, 2014, 11:21 PM
I have Ubuntu Server 12.04 with two LAN connected printers. They are shared via SAMBA, so we may have some differences.

I don't have:

AuthInfoRequired
In my printers.conf

I can't find any reference to "AuthInfoRequired" in either man pages for printers.conf nor cupsd.conf
Can you simply delete that line?
Are you sure cupsd is stopped when you edit?

What is your goal? Do you want anyone to be able to print, or are you trying to employ some sort of authentication on the printers?

Can you post your printers.conf and cupsd.conf

ChrisRChamberlain
March 19th, 2014, 10:22 AM
volkswagner

Did not explain properly - apologies.

The printers on the Ubuntu server can printed through by all the Windows boxes and the server itself, no credentials required.

It's the desktop Ubuntu that is seeking to impose credentials before connecting to the server.

CUPS is stopped with the following command
sudo /etc/init.d/cups stop and restarted with
sudo /etc/init.d/cups restart

This is the desktop Ubuntu '/etc/cups/printers.conf' with an example printer.


# Printer configuration file for CUPS v1.7rc1
# Written by cupsd
# DO NOT EDIT THIS FILE WHEN CUPSD IS RUNNING
<DefaultPrinter HP-PSC-1310>
UUID urn:uuid:2d997e22-a8ee-3fd8-583a-2acdf5d84334
AuthInfoRequired username,password
Info HP PSC 1310
Location
MakeModel HP PSC 1310 Series, hpcups 3.13.9
DeviceURI smb://econel/psc-1310-series
State Idle
StateTime 1395220089
Type 36892
Accepting Yes
Shared Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
OpPolicy default
ErrorPolicy retry-job
</Printer>

Removing or editing the sixth line and saving appears to work. Attempt to print and the original file reappears.

Entering credentials simply puts you into a loop and nothing gets printed

volkswagner
March 19th, 2014, 09:06 PM
This seems to be a long running bug/issue without much in the area of fix or workaround.

Have you tried specifying the user/pwd like in this thread (http://serverfault.com/questions/104935/authinforequired-cups-overwrites).

ChrisRChamberlain
March 20th, 2014, 09:42 AM
volkswagner

Thanks for the link - sadly, neither suggestion worked.

Not wishing to start a rant, but for Ubuntu to be a serious alternative to Windows XP and the like, issues such as this and the one resolved in this thread (http://ubuntuforums.org/showthread.php?t=2209341) need to be addressed. :(

volkswagner
March 21st, 2014, 12:48 AM
Have you looked tried both options like in this thread ( set AuthInfoRequired none, and add user pwd to printer path)
http://ubuntuforums.org/archive/index.php/t-1249318.html

Have you tried deleting the printer and adding it back? How are you adding the printer (localhost:631)?
What does the samba config look like for the printer?
Also in the above link, check for stale jobs on the server via /var/spool/samba and /var/spool/cups.

ChrisRChamberlain
March 21st, 2014, 11:57 AM
volkswagner


Have you looked tried both options like in this thread ( set AuthInfoRequired none, and add user pwd to printer path)Yes, neither worked


Have you tried deleting the printer and adding it back?
Yes


How are you adding the printer (localhost:631)?
Tried through localhost and printers dialog


What does the samba config look like for the printer?Please advise possible path


Also in the above link, check for stale jobs on the server via /var/spool/samba and /var/spool/cups.Nothing there.

If you attempt to print a test page through localhost:631, there is an error "NT_STATUS_ACCESS_DENIED opening remote spool Test Page"

"smb://servername/psc-1310-series" is the connection although "smb://username:password@servername/psc-1310-series" was originally entered.

(Apologies for the smiley, not of my doing)

ChrisRChamberlain
March 21st, 2014, 12:10 PM
Just deleted and reinstalled through localhost:631 without username:password@...

Different error message is
Session setup failed: NT_STATUS_LOGON_FAILURE

volkswagner
March 21st, 2014, 12:33 PM
I assume your Ubuntu Server 12.04 hosting the printers = econel
From that server post /etc/samba/smb.conf

ChrisRChamberlain
March 21st, 2014, 05:09 PM
volkswagner

printers section from /etc/samba/smb.conf

[printers]
path = /tmp
printable = yes
guest ok = yes
browseable = no

ChrisRChamberlain
March 21st, 2014, 05:37 PM
Just as background there is also a network printer attached to the Ubuntu 13.10 desktop.

There is no
AuthInfoRequired username,passwordrelative to this printer.
# Printer configuration file for CUPS v1.7rc1
# Written by cupsd
# DO NOT EDIT THIS FILE WHEN CUPSD IS RUNNING
<DefaultPrinter HP-Officejet-7300-series>
UUID urn:uuid:9f9951d5-c228-3d85-6670-881c2817b7d5
Info HP Officejet 7300 series
MakeModel HP Officejet 7300 Series, hpcups 3.13.9
DeviceURI hp:/net/Officejet_7300_series?zc=HPALLINONE
State Idle
StateTime 1395305194
Type 36892
Accepting Yes
Shared Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
OpPolicy default
ErrorPolicy retry-job
</Printer>
<Printer psc-1310-series>
UUID urn:uuid:a13993cc-061f-3fa6-655c-aab5add706c0
AuthInfoRequired username,password
Info psc-1310-series
Location
MakeModel HP PSC 1310 Series, hpcups 3.13.9
DeviceURI smb://econel/psc-1310-series
State Idle
StateTime 1395399945
Type 36892
Accepting Yes
Shared No
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
OpPolicy default
ErrorPolicy retry-job
</Printer>

volkswagner
March 22nd, 2014, 03:45 PM
I feel your frustration on this. I was so interested in this issue, I created a 13.10 VM

I was very impressed how 13.10 and CUPS found my two printers hosted on a different CUPS server. I could
print to them right away!

I do share the same/similar problem with SAMBA shared printers. The printers.conf does continuously get overwritten.
I was not even getting a dialog box to enter credentials. I realized I never setup my workgroup. I changed smb.conf
to include my workgroup name, but still did not get dialog box. Since I do have a SAMBA4 DC, I joined 13.10 to the domain
using likewise. Still no dialog box.

Since CUPS was created by Apple, I checked my OSX machine.... which can print to the SAMBA printers. It has:

AuthInfoRequired negotiate

So I tried adding that to printers.conf on 13.10. This got me a dialog popup, but no place to enter user/pwd. It also
quickly got overwritten when trying to print.

Oddly, I had a problem with earlier version of OSX. I had blamed OSX's version of smbclient. when I upgraded to OSX 10.7 from 10.6, I was able to print
to the printer via samba user. Now I'm not so sure if the newer smbclient fixed the issue of if specific version of CUPS fixed the issue. Oddly OSX 10.7 has
a proprietary implementation of smbclient, vs 10.6 running SAMBA's smbclient. Although I'm not sure if these issues are related, I'm going to link that thread (http://ubuntuforums.org/showthread.php?t=2207447)

For comparison, non working setups = Ubuntu 13.10: CUPS ver 1.7rc1, smbclient Ver 3.6.18, OSX 10.6 CUPS ver 1.4.7, smbclient Ver 3.0.28a-apple
Working setup = OSX 10.7 CUPS ver 1.5.4, unknown proprietary version of smbclient.

Well Not sure if any of the above matters.

See next post!

volkswagner
March 22nd, 2014, 04:35 PM
I have successfully added printer in the following environment:

Client = Ubuntu 13.10 Desktop 32bit
PrintServer = Ubuntu 12.04 server Samba Version 3.6.3, CUPS Version 1.5.3
Both print server and client joined to SAMBA4 Domain Controller, Debian 7

Steps to add printer on Ubuntu 13.10

Install appropriate driver for printer Brother HL2240D. Use new install script from Brother (Thank You Brother!).
Oddly there was an issue adding the printer via the driver installer, no big deal though.

Add Printer:
Logged into system as user part of lpadmin group.
System Settings > Printers > + Add > "Expand Network Printer" > "Windows Printer via SAMBA" > select <Browse>
Navigate to <Workgroup> <Machine> I had to enter samba credential here to see the printers listed
The dialog had prefilled my username and workgroup, I simply had to enter password.
Things to note here, my user happens to be a domain admin, so I'm not sure if this influences behavior.
After entering password, select printer from list, <OK>,
The above fills in the smb: path, then I select radio button "Set Authentication Details Below"
Fill in fields as follows (substituting acutual workgroup and samba username):
user = WORKGROUP/username
pwd = yoursecret

Click <Verify>, get response "Print Share Verified" "The print share is accessible"
then click <OK>
Click <Forward> system will search for drivers
I select may manufacturer "Brother" from the list, then find my recently installed driver listed as "HL2240D for CUPS"
You should be able to print a test page after clicking <Apply>

Here is a portion of my printers.conf, notice the escaping of "/" in WORKGROUP/username which looks like %2F.

<DefaultPrinter BroLaser>
UUID urn:uuid:e3ebab44-641e-39ac-6089-2201015a4a66
Info HL2240D
Location Computer Cabinet
MakeModel Brother HL2240D for CUPS
DeviceURI smb://MYWORKGROUP%2Fusername:secret@MYWORKGROUP/BUNTU/OfficeLaser
State Idle

volkswagner
March 22nd, 2014, 04:47 PM
Well, these errors may be more of a driver issue. I say this because all of my early testing was while using Raw for printer
drivers. Now I get different results after installing manufacturers drivers.

I decided to see what would happen if I did not want my username and password in clear text inside printers.conf.

I went in and edited the properties of my printer and set "request user password info if required".

This changed my printers.conf as follows and I can print simply by entering username and password without workgroup.


</Printer>
<Printer MFC>
UUID urn:uuid:254b096d-f593-3d4c-4ecd-064566856039
AuthInfoRequired username,password
Info Brother MFC-5890CN
Location Office
MakeModel Brother MFC-5890CN CUPS v1.1
DeviceURI smb://BUNTU/MFC
State Idle
StateTime 1395502459
Type 8433740
Accepting Yes
Shared Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
OpPolicy default
ErrorPolicy retry-job
</Printer>
<Printer MFC5890CN>


The above accepts my username and password when prompted, and prints.

Notice the "CUPS v1.1" described at MakeModel.

*** Update ***
I wanted to see if using bad drivers would break the auth. I used Desktop GUI <System Preferences> to modify the printer, selecting
a generic driver. Sent a print job to printer, it did authenticate, but did not print (no shocker there). I went to https://localhost:631
and set driver back to original factory driver, and tried to reprint via CUPS "Completed Jobs" page. Now I get NT_Status error.

I think it is important to use system preferences to do the setup. There is something happening in the auth when selecting the printer
from the SMB drop down.

*** update 2 ***
I change my mind. I don't think this is a driver issue. It seems setup steps are critical. You must first specify the user name and password
in the printer setup. You can later change this (to "prompt for password..."), so info must be stored in the ppd file or something. This is a bit above my skill level. I guess
this is likely a bug.

*** Update 3 ***
One thing to note, when using dialog popup for printer you normally don't get the checkbox "remember password". Also when first printing
you won't get the popup because printers.conf is not updated yet to prompt you. First print job you'll have to go to print cue from system tray,
then right click the print job and choose authenticate. So if later on you decide you want the checkbox selected, you may want to enter an
incorrect password, then go to the print cue to right click the print job and then choose authenticate and check the box to remember password.

*** Update 4 ***
Checking the check box for "remember password" does not seem to work for me. Even during the same user login session, I still have to always
enter password.

ChrisRChamberlain
March 23rd, 2014, 09:43 AM
Wow - you've been busy!
Add Printer:
Logged into system as user part of lpadmin group.
System Settings > Printers > + Add > "Expand Network Printer" > "Windows Printer via SAMBA" > select <Browse>
Navigate to <Workgroup> <Machine> I had to enter samba credential here to see the printers listed
The dialog had prefilled my username and workgroup, I simply had to enter password.
Things to note here, my user happens to be a domain admin, so I'm not sure if this influences behavior.
After entering password, select printer from list, <OK>,
The above fills in the smb: path, then I select radio button "Set Authentication Details Below"
Fill in fields as follows (substituting acutual workgroup and samba username):
user = WORKGROUP/username
pwd = yoursecret

Click <Verify>, get response "Print Share Verified" "The print share is accessible"
then click <OK>Followed those instructions but it does not validate. For convenience and with known users, the 'Guest' account is used in SAMBA, so maybe there's a problem there of ones own making as far as these printers is concerned?

Where Windows credentials require a username/password to access shares such as USB drives attached to the server, the username is that for the server as is the password.

Tried those for the printer setup from Ubuntu 13.10 desktop without success.

volkswagner
March 23rd, 2014, 12:25 PM
Wow - you've been busy!Followed those instructions but it does not validate. For convenience and with known users, the 'Guest' account is used in SAMBA, so maybe there's a problem there of ones own making as far as these printers is concerned?

Where Windows credentials require a username/password to access shares such as USB drives attached to the server, the username is that for the server as is the password.

Tried those for the printer setup from Ubuntu 13.10 desktop without success.

I'm sorry but I don't fully understand. I sounds like each user does not have a samba account on the 12.04 server, is this true.

From the test server can you run:


cd /etc/samba
sudo testparm -s smb.conf >smb.txt
Then post contents of /etc/samba/smb.txt

What version of samba are you using on the server (samba3 or samba4)?

I may have some differences since I'm running a SAMBA4 domain.

You will need to authenticate the printer with a real samba user and password. If you don't mind this info in
clear text on the server's printers.conf.

I have learned that on my setup, the printer share is not honored. I have to comment out "restrict anonymous = 2"
on my print server for all users to print, even though they are in the "domain users" group and should allowed to print
according to share definition.

Even with the "restrict anonymous = 2" commented out, it allowed the printer to show in the list during setup, but it still
won't authenticate using guest. This is true even though I can run:

smbclient -L prntsrv -U guest
Leave password empty and I'll see list of shares including printers.


Definitely some annoying bug going on here. Also I'm not sure if I need to install samba3 server on the 13.10 client, as the default only
has smbclient installed.

I have not been successful in using guest account at all.

*** EDIT ***
Well it seems "smbclient -L prntsrv -U guest" is not really a valid test.

It also seems only the Domain Admins can actually validate the printer in the setup screen. I did mention earlier that my user is a domain
admin, but I wanted to verify this may be the issue. I think the Ubuntu desktop expects the user to be local lpadmin or something weird.

*** EDIT 2 ***
I have confirmed, to verify printer user must be part of Domain Admins in my environment!

ChrisRChamberlain
March 24th, 2014, 09:17 AM
cd /etc/samba
sudo testparm -s smb.conf >smb.txtGetting 'Permission denied' when attempting to run the second line.

Please advise how to check the version of SAMBA?

ChrisRChamberlain
March 24th, 2014, 10:31 AM
SAMBA version is 3.6.3

volkswagner
March 24th, 2014, 11:40 AM
Did you run:

sudo testparm -s smb.conf >smb.txt

Can you post smb.txt?

ChrisRChamberlain
March 24th, 2014, 12:53 PM
Sorry, you seemed to have missed this.

cd /etc/samba
sudo testparm -s smb.conf >smb.txt
Getting 'Permission denied' when attempting to run the second line.
Could post ../smb.conf?

volkswagner
March 24th, 2014, 01:17 PM
Yes, I did miss that line ;)

You can post smb.conf or try switching to root user:



sudo su
cd /etc/samba
testparm -s smb.conf >smb.txt
cat smb.txt
exit

ChrisRChamberlain
March 24th, 2014, 03:14 PM
Content of smb.txt, edited to remove shares showing personal data.

[global]
server string =
map to guest = Bad User
null passwords = Yes
username map = /etc/samba/smbusers
syslog only = Yes
announce version = 5.0
name resolve order = hosts wins bcast
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=8192 SO_SNDBUF=8192
printcap name = CUPS
wins support = Yes
usershare owner only = No
idmap config * : backend = tdb

[print$]
path = /var/lib/samba/printers
write list = root
create mask = 0664
directory mask = 0775
guest ok = Yes

[printers]
path = /tmp
guest ok = Yes
printable = Yes
print ok = Yes
browseable = No

[Hitachi]
path = /media/Hitachi/
read only = No
create mask = 0644
guest ok = Yes

[Maxtor]
path = /media/Maxtor/
read only = No
create mask = 0644
guest ok = Yes

[Seagate]
path = /media/SEA_DISC/
read only = No
create mask = 0644
guest ok = Yes

[Targa]
path = /media/Targa/
read only = No
create mask = 0644
guest ok = Yes

[Ubuntu One]
path = /home/chris/Ubuntu One/
read only = No
create mask = 0644
guest ok = Yes

[WebSites]
path = /var/www/
read only = No
create mask = 0644
guest ok = Yes

[Data]
path = /var/data/
read only = No
create mask = 0644
guest ok = Yes

[Samsung]
path = /var/
read only = No
create mask = 0644
guest ok = Yes

[Drive_D]
path = /media/Drive_D/
read only = No
create mask = 0644
guest ok = Yes

volkswagner
March 24th, 2014, 04:33 PM
I'm not certain on samba defaults. You can run
testparm -v to see every option and what you specified or samba's default. Look for "security =".
You should likely want security = user. You also don't have your workgroup defined.
Also are you trying to authenticate the printer from a user with a blank password?
Does the user exist on the server as both a unix user and samba user. I'd first try to see if you can get the steps I mentioned for setting up the printer via 13.10 Settings > Printers >...
Try Using a user that exists on the server as both a unix user and samba user. You may even want the user to be part of lpadmin group on the server.

ChrisRChamberlain
March 24th, 2014, 05:34 PM
Top of ../smb.conf with only "security =" reference

[global]
; General server settings
netbios name = ECONEL
server string =
workgroup = WORKGROUP
announce version = 5.0
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=8192 SO_SNDBUF=8192
passdb backend = tdbsam
security = user
map to guest = Bad User
; guest account = nobody
null passwords = true
username map = /etc/samba/smbusers
name resolve order = hosts wins bcast
wins support = yes
# load printers = yes
printing = CUPS
printcap name = CUPS
syslog = 1
syslog only = yes
usershare owner only = false

You also don't have your workgroup defined.In previous posts, I assumed this referred to the Windows WORKGROUP which exists following the inclusion of a Win XP box on the network.
Also are you trying to authenticate the printer from a user with a blank password?Have attempted that and also used the one user on the server, "username", and the relevant password.
Does the user exist on the server as both a unix user and samba user.Unix only but will add as a SAMBA user and try again.

ChrisRChamberlain
March 24th, 2014, 05:50 PM
Added self as SAMBA user, restarted SAMBA and attempted all known options to add printer through printer dialog on Ubuntu 1310 desktop.

Document Print Status stuck at 'Held for...'

ChrisRChamberlain
March 24th, 2014, 05:51 PM
Duplicate post - please ignore

volkswagner
March 24th, 2014, 11:49 PM
Added self as SAMBA user, restarted SAMBA and attempted all known options to add printer through printer dialog on Ubuntu 1310 desktop.

Document Print Status stuck at 'Held for...'

OK, so when you used printer dialog you selected "Set Authentication Details Below" and entered the username and password, then hit <verify>?

This bug is really bugging me!
;)

ChrisRChamberlain
March 25th, 2014, 10:27 AM
As an experiment, stopped CUPS

Added printer on 13.10 through dialog, Windows Printer via SAMBA, smb://WORKGROUP/econel/psc-1310-series.

Chose Authentication 'Prompt....'., so not entering username/password

Did not attempt to print test page.

Viewed ../printer.conf
# Printer configuration file for CUPS v1.7rc1
# Written by cupsd
# DO NOT EDIT THIS FILE WHEN CUPSD IS RUNNING
<DefaultPrinter HP-Officejet-7300-series>
UUID urn:uuid:9f9951d5-c228-3d85-6670-881c2817b7d5
Info HP Officejet 7300 series
MakeModel HP Officejet 7300 Series, hpcups 3.13.9
DeviceURI hp:/net/Officejet_7300_series?zc=HPALLINONE
State Idle
StateTime 1395305194
Type 36892
Accepting Yes
Shared Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
OpPolicy default
ErrorPolicy retry-job
</Printer>
<Printer HP-PSC-1310>
UUID urn:uuid:fc9548b1-f3de-37e0-7b13-e2fee1374509
Info HP PSC 1310
Location
MakeModel HP PSC 1310 Series, hpcups 3.13.9
DeviceURI smb://WORKGROUP/econel/psc-1310-series
State Idle
StateTime 1395738006
Type 36892
Accepting Yes
Shared Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
OpPolicy default
ErrorPolicy retry-job
</Printer>Started CUPS again.

Checked .../printers.conf - still no 'AuthInfoRequired username,password' line.

Attempted to print, and behold CUPS has modified ../printers.conf and added in the line 'AuthInfoRequired username,password'

Unable to proceed beyond the loop.

Morbius1
March 25th, 2014, 01:09 PM
I usually don't like to enter printer questions because it's always worked for me and I really have no experience in debugging issues but ............

Not sure why you are trying to access cups through samba between two Linux boxes but do you get the same rewrite of printers.conf when you use ipp, as in:

ipp://econel:631/printers/psc-1310-series
If you are using samba becasue you can not resolve the host name without it you can bypass that as well since all Linux systems use mdns / avahi ( as in hostname.local ):

ipp://econel.local:631/printers/psc-1310-series
There is an obscure bug that seems printer dependent that requires you to use ipp14 instead of ipp:

ipp14://econel.local:631/printers/psc-1310-series

The only reason I bring this up is becase after a very quick search of this phenomenon it always seems connected to going through Samba.

ChrisRChamberlain
March 25th, 2014, 05:13 PM
Morbius1

Thanks for your reply.

Tried all 3 suggestions but each time it was either the printer not being found, not responding or not connected.

volkswagner
March 25th, 2014, 10:35 PM
Do you have share printers enabled in CUPS interface?

Morbius1, I was hoping you would jump in here. I value your SAMBA advise/expertise immensely.
I do feel this (SAMBA share printers to UNIX clients) is a necessary component to implement a centrally managed network using a Domain Controller.
It's unfortunate I have not been able to properly debug.

Do you know how to capture what the smbclient is sending as credentials? I'm having a hard time determining if this is CUPS or smbclient. My guess
is smbclient is to blame since Lion OSX's proprietary "smbclient" does not have the problem.
I do think if we were able to have CUPS maintain the auth like Mac OSX does, we'd have better results.
Here is how OSX handles it:

AuthInfoRequired negotiate

ChrisRChamberlain
March 26th, 2014, 09:18 AM
Do you have share printers enabled in CUPS interface?Yes, the 10+ Windows boxes use them daily without credentials having been required to setup the printers.
Do you know how to capture what the smbclient is sending as credentials?No, please advise.

volkswagner
March 26th, 2014, 11:44 AM
It is possible to share the printers through SAMBA without checking the box "Share Printers on this System" on the CUPS admin page, so it's worth
double checking if you are now trying to share directly via CUPS and ipp://

ChrisRChamberlain
March 26th, 2014, 12:08 PM
On the CUPS admin tab, 'Share printers connected to this system' is unchecked as are all other 'Advanced' options

volkswagner
March 26th, 2014, 01:38 PM
You will want to enable the sharing if you want to share via ipp://

ChrisRChamberlain
March 26th, 2014, 01:57 PM
That did it!

Device URL:
ipp://econel.local:631/printers/psc-1310-series

Many, many thanks for your patience and persistence, and also thanks to Morbius1 for his input.

I hope this thread will be of use to others.

jbierkens
May 26th, 2014, 06:12 PM
I just discovered this thread and read it with interest, as I am having a similar issue.

Trying to use SAMBA printing at work. Printer hg-00-825 at smb://printsmb.science.ru.nl. You may get an idea of the printer situation at my work environment from the link http://wiki.science.ru.nl/cncz/Printers_en_printen

Whenever I send a job to the printer, I am asked for authentication. Once I enter my credentials, the same authentication dialog reappears.

I have contacted technical support at work. They say that my job is authenticated just fine, but as soon as that is done, my pc disconnects from the printer. (Can this be due to a restarted cups daemon?) They did not know what to do from there, as the problem seems to occur on my pc.

Actually, this happens on two of my pc's. I have upgraded both pc's at different times to Xubuntu 14.04 and since this upgrade, I have this problem.

Based on the latest posts, I tried printing to

ipp://printsmb.science.ru.nl/pr-hg-00-825
to no avail. When checking "Policies" in the "Printer Properties", I see that "Shared" is enabled.

This issue is annoying the hell out of me as I cannot print currently. I have gone through the effort of installing Xubuntu 14.04 afresh, but this did not help.

Would you please have any suggestions? Thank you very much.

Update:
- printer state after trying to print test page:


Idle - NT_STATUS_ACCESS_DENIED opening remote spool Test Page

- printers section from /etc/samba/smb.conf


[printers]
comment = All Printers
browseable = no
path = /var/spool/samba
printable = yes
guest ok = no
read only = yes
create mask = 0700

- contents of /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 pr-hg-00-825>
UUID urn:uuid:a3612b6f-f4ba-350b-6580-02459ccad296
AuthInfoRequired none
Info
Location
DeviceURI smb://printsmb.science.ru.nl/pr-hg-00-825
PPDTimeStamp *
State Idle
StateTime 1401123699
Type 8401100
Accepting Yes
Shared Yes
ColorManaged Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
OpPolicy default
ErrorPolicy retry-job
Option media-col media-bottom-margin
</Printer>

volkswagner
May 26th, 2014, 09:56 PM
I just discovered this thread and read it with interest, as I am having a similar issue.

[snip]

Based on the latest posts, I tried printing to

ipp://printsmb.science.ru.nl/pr-hg-00-825





Have you tried adding the port 631 like previous poster?

ipp://printsmb.science.ru.nl:631/pr-hg-00-825

or with username and password in url like the wiki shows:

smb://username:password@printsmb.science.ru.nl/<printername>

Also what version of SAMBA is the server running?

jbierkens
May 27th, 2014, 11:46 AM
Thank you volkswagner. Unfortunately, adding the port does not help. There is still the infinite authentication loop problem, and the print status is now


Idle - Connected to printer.


Your second suggestion of using the username:password in the printer url, I have tried this already more times than I can count...

Update: the server is running Ubuntu 12.04.4 LTS and Samba 3.6.3.

volkswagner
May 27th, 2014, 01:12 PM
The file you posted (printers.conf) is that from the client or the server? If it's from the client, make sure sharing is
enabled on the CUPS server so you can connect via ipp://

I know this is a bug, but I have yet to determine if it's SAMBA server, smbclient, CUPS server or CUPS client.

I know the setup works with with OSX Lion and later as the client, but not Ubuntu 13.10 as client.

jbierkens
May 27th, 2014, 05:15 PM
The printers.conf I posted is from the client pc. The technical support at my employer have let me known that ipp will not work. As alternative they offer to provide Kerberos authentication.

@volkswagner: Are you working on this bug for ubuntu? Is there a bug report on this at launchpad? Let me know if you'd like to know more. Is there any workaround that you can think of?

volkswagner
May 27th, 2014, 11:41 PM
I have not filed a bug report. I'm not sure if this is specific to Ubuntu, SAMBA or CUPS.

As far as work arounds, ipp would be the best, or any connection method which would avoid SAMBA
(direct connection to CUPS) such as your admin's kerberos suggestion.

I'd be curious if your admin's would give a try connecting to the printer via your workstation as a domain admin to test my theory in
this post (http://ubuntuforums.org/showthread.php?t=2211933&p=12965332#post12965332).

I may try spinning up and old Ubuntu live cd to see if the problem exists back in 7.04

volkswagner
May 28th, 2014, 01:32 AM
I did spin up Ubuntu 7.04 live CD. The behavior is exactly the same in my environment.

The user needs to be part of the domain admin group to print.

Oddly, Ubuntu 7.04's /etc/cups/printers.conf file does not even contain the "AuthInfoRequired" line at all.

I'm still having a hard time blaming the server, when OSX clients (Lion and later) don't have the same issue.
Perhaps I need to really compare cups.conf between working OSX and non-working clients.

Here is what Ubuntu 7.04's /etc/cups/printers.conf client generated.

Printer configuration file for CUPS v1.2.8
# Written by cupsd on 2014-05-27 23:03
<Printer HL2240D>
Info HL2240D
DeviceURI smb://DOMAIN\eric:secret@BUNTU/OfficeLaser
State Idle
StateTime 1401231729
Accepting Yes
Shared Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
OpPolicy default
ErrorPolicy retry-job
</Printer>


For reference: non working OSX clients have:

AuthInfoRequired username,password

jbierkens
May 28th, 2014, 09:48 AM
You say this happens in Ubuntu 7.04. Is this consistent with my experience, that the error occurs after upgrading to 14.04 (or possibly a slightly earlier release that I skipped), and not before?

I'll ask the administrators whether they would try to connect to the printer through my pc as admin.

jbierkens
May 28th, 2014, 12:23 PM
Could the issue be Xubuntu specific? I am asking because the system administrators do not know about the issue, and I assume that at my work (science department of a university) many people are using Ubuntu 14.04. When I am at work next week, I might try a usual Ubuntu Live CD.

volkswagner
May 28th, 2014, 12:43 PM
The original poster in this thread was using Ubuntu 13.10 as client. I see threads all over the net
with similar problems and various operating systems. I don't think it's limited to Xubuntu.

Keep us posted.

jbierkens
June 12th, 2014, 09:27 AM
@volkswagner:
ultimately, this seems to be some issue at the server side: changing servername from

printsmb.science.ru.nl
into

printsmb
did the trick.

volkswagner
June 12th, 2014, 12:08 PM
jbierkens, thanks for the update. Would you mind explaining a little more on your fix and posting your working printers.conf file?

Did you make changes on the server and client? I'm curious if you printers.conf file is storing your username and password.

Did you get a dialog box upon first printing (to input user/password) or was this accomplished during the printer setup wizard?

jbierkens
June 12th, 2014, 12:35 PM
Would you mind explaining a little more on your fix and posting your working printers.conf file?

I installed the printer afresh using the wizard, and the installation instructions here (http://wiki.science.ru.nl/cncz/Printers_en_printen#.5BAfdrukken_op_andere_Linux_m achines.5D.5BPrinting_on_other_Linux_machines.5D), but using the URI


smp://printsmb/pr-hg-00-825

instead (so without adding username and password). I got an authentication failure when trying to print a test page. But after adding user name and password to the URI, printing a test page worked. When printing something from another application, an authentication dialog showed up, but entering the right credentials resulting in a correct printout. The printers.conf is


# Printer configuration file for CUPS v1.7.2
# Written by cupsd
# DO NOT EDIT THIS FILE WHEN CUPSD IS RUNNING
<DefaultPrinter pr-hg-00-825>
UUID urn:uuid:da822e3d-dfe6-3fff-5007-7ee54033d21a
AuthInfoRequired username,password
Info pr-hg-00-825
DeviceURI smb://my_username:my_passsword@printsmb/pr-hg-00-825
PPDTimeStamp *
State Idle
StateTime 1402562961
Type 8401100
Accepting Yes
Shared Yes
ColorManaged Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
OpPolicy default
ErrorPolicy retry-job
Option media-col media-bottom-margin
</Printer>





Did you make changes on the server and client? I'm curious if you printers.conf file is storing your username and password.

Only on client side, I do not have access to the server side. Also just to be sure I tried using the original URI,
so


smb://username:password@printsmb.science.ru.nl/pr-hg-00-825

which gave the error


Idle - NT_STATUS_ACCESS_DENIED opening remote spool Test Page

when trying a test page.



Did you get a dialog box upon first printing (to input user/password) or was this accomplished during the printer setup wizard?
This is answered by my description above. Let me know if you would like me to experiment some more.

volkswagner
June 12th, 2014, 01:41 PM
Thanks for sharing.

Unfortunately this does not work in my environment. Oddly my printers.conf shows:

DeviceURI smb://user:secret@buntu/MFC

but when I navigate to the printer GUI settings the device URI simply shows

DeviceURI smb://buntu/MFC

I have tried all iterations of including domain name with username or domain name as part of machine name.

What I end up with is print jobs waiting for authentication, if I try to force authentication with various username configs (with or without domain) it fails to auth.

I'm curious how your print jobs show up, ie what does the user look like? Since I'm logged into the linux machine as a domain user, my print jobs
come from user like

DOMAIN/username

I wonder if I need to add a local user on the client with the same user/pwd???

I'm also curious if you can find server info, such as does the server specify printers in share info? I simply use the following in smb.conf

load printers = yes

jbierkens
June 12th, 2014, 01:48 PM
I'm curious how your print jobs show up, ie what does the user look like?


I wouldn't know how to see this right now. What command would I need?



I wonder if I need to add a local user on the client with the same user/pwd???


I am printing with a different username on my local machine than that of the printer. Perhaps this has something to do with the issue we are experiencing.



I'm also curious if you can find server info, such as does the server specify printers in share info?

How would I find out this?

volkswagner
June 12th, 2014, 02:45 PM
I wouldn't know how to see this right now. What command would I need?
If you open printer job queue you'll see the username. It's easy to see when the print job hangs in the queue... you may need to open the queue first.



I am printing with a different username on my local machine than that of the printer. Perhaps this has something to do with the issue we are experiencing.

Can you explain the users? Is the printer user a domain user and the logged in user only local to the machine?



How would I find out this?
you would need to ask your SAMBA administrator to check contents of /etc/samba/smb.conf