5

Having trouble with samba printing. I have a CUPS printer installed on an Ubuntu 11.04 server and that works great.

When I try to configure samba to allow an XP machine to use the printer, it fails when printing. I can install the printer drivers for XP from the server and the printer appears in the XP printer control panels. When I try to print a test page from the XP machine I get this error in the system event log:

Jun 27 20:33:29 FatController smbd[3571]: [2012/06/27 20:33:29,  0] rpc_server/srv_netlog_nt.c:603(_netr_ServerAuthenticate3)
Jun 27 20:33:29 FatController smbd[3571]:   _netr_ServerAuthenticate3: netlogon_creds_server_check failed. Rejecting auth request from client JAMES machine account JAMES$

Here's my smb.conf file:

[global]
server string = %h (Server)
workgroup = SODOR
encrypt passwords = true
security = user
os level = 255
preferred master = yes
domain master = yes
local master = yes
logon path = \\%L\profile\%U
logon drive = S:
logon home = \\%L\home\%U
domain logons = yes
map to guest = Never
guest ok = no
dns proxy = no
time server = yes
logon script = logon.bat
load printers = yes
printing = cups
printcap name = cups
nt acl support = no
interfaces = eth1 lo
bind interfaces only = yes
smb ports = 445

[netlogon]
comment = Net Log On
path = /home/samba/netlogon
guest ok = no
read only = yes
browseable = no

[profile]
comment = User Profiles
path = /home/samba/profiles
read only = no
create mask = 0600
directory mask = 0700
browseable = no
store dos attributes = yes

[printers]
comment = All Printers
path = /var/spool/samba
browseable = yes
guest ok = no
printable = yes

[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
browseable = yes
guest ok = no
read only = yes
write list = root, skizz

Anyone know what the problem is and how to fix it?

In addition to the above, I also get this error:

Jun 27 21:56:35 FatController smbd[3571]: [2012/06/27 21:56:35,  0] printing/print_cups.c:1027(cups_job_submit)
Jun 27 21:56:35 FatController smbd[3571]:   Unable to print file to `Edward' - client-error-not-authorized

which I think is more relevant.

3 Answers 3

5
  • If your not too attached to using Samba you can share a printer using IPP:

    The preferred way to connect a Windows client to a Linux print server is using IPP. It's a standard printer protocol based on HTTP, allowing you all ways to profit from port forwarding, tunneling etc. The configuration is very easy and this way is less error-prone than using Samba. IPP is natively supported by Windows since Windows 2000. To configure the server side you need to enable browsing in /etc/cups/cupsd.conf, by adding the line "BrowesAllow all":

     Browsing On
     BrowseOrder allow,deny
     BrowseAllow @LOCAL
     BrowseAllow all
    

    On the Windows computer, go to the printer control panel and choose to 'Add a New Printer'. Next, choose to give a URL. For the URL, type in the location of the printer: http://host_ip_address:631/printers/printer_name (where host_ip_address is the GNU/Linux server's IP address and printer_name is the name of the printer being connected to).

    After this, install the native printer drivers for your printer on the Windows computer. If the CUPS server is set up to use its own printer drivers, then you can just select a generic postscript printer for the Windows client(e.g. 'HP Color LaserJet 8500 PS' or 'Xerox DocuTech 135 PS2'). Then test the print setup by printing a test page.

  • If you must use Samba to share, you could adding a write list to smb.conf:

    [printers]
    comment = All Printers
    path = /var/spool/samba
    browseable = yes
    guest ok = no
    printable = yes
    create mode=0700
    write list=@adm root <username>
    

All of the above info I found at this wiki, which has more info then what I included here. Hope that helps!

3
  • I'm not attached to Samba. It's just that I already had it (for the Windows network share stuff) and I'd read it can interface to CUPS to share printers. I'll try your samba update first and if that doesn't work I'll try the IPP. I take it that using IPP that print jobs can be authenticated by user?
    – Skizz
    Jun 28, 2012 at 7:15
  • You can require authentication in cupsd.conf, by setting AuthType Basic and Require user, in the appropriate sections you want to be authenticated. I haven't needed authenticated printing on windows though, so I haven't tried it out yet.
    – jpetersen
    Jun 28, 2012 at 22:55
  • Samba didn't work. But the IPP method worked a treat. Thanks.
    – Skizz
    Jul 3, 2012 at 8:45
2

I also had this problem w/ a printer attached to a computer running Ubuntu 12.04, and trying to print from a Windows XP computer. I found out that there is a known bug in samba.

sudo add-apt-repository ppa:louis-bouchard/samba-lp967410
sudo apt-get update
sudo apt-get upgrade

And then I had to have the samba database regenerated.

sudo rm -f /var/lib/samba/registry.tdb
sudo rm -f /var/cache/samba/printing/*
sudo restart smbd
sudo restart mnbd

And then it worked. I have a support contract w/ canonical and they helped fix this.

1

All the manuals say that under the share options you may have read only = yes. It turned out to me, that write possibility is required (a samba bug?). That's what jpetersen put as write list=@adm root <username>.

When I have no write access, zero sized files appear under /var/spool/samba. When I map the shares as root - I succeed.

Finally I made it work by adding in [printers] section:

read only = no

I also have the following, to simplify things and make debugging and troubleshooting easier:

[global]
max protocol=NT1
smb ports=139

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .