cupsaddsmb problem with Samba printer share with 'security = share' - solution

Paul McIlfatrick paul.mcilfatrick at
Wed May 14 00:56:28 PDT 2008

> I have been building a replacement CUPS printer server for our office on Ubuntu 8.04 server (used apt-get to download the latest CUPS and Samba packages) and I have got the cupsaddsmb tool to copy the PostScript drivers and make them available for our office PCs. The cupsaddsmb tool is great!
> However, there is one issue I have found with the cupsaddsmb tool in that it works fine if I set 'security = user' for the Samba printer share.
> But the problem with this security setting is that our users are not then able to access the Samba printer share without logging in. I have to set 'security = share' for the Samba printer share to allow them to access it but this then breaks the cupsaddsmb tool!
> I have searched this forum but was unable to find anything of help and Google did not turn up anything helpful (probably didn't phrase the question correctly).
> Also, I have read through chapters 21 and 22 of the extensive documentation written by Kurt Pfeifle but I can't seem to find mention of this issue (probably it is there somewhere).
> There is probably a problem with my smb.conf file which I have

I posted in this newsgroup because I believe that cupsaddsmb is a CUPS written tool but I eventually found the solution in a Samba newsgroup reply.

The global section of the smb.conf file needs the following line added:

map to guest = Bad User

and then in the smbuser file the following line needs to be added:

foo = *

My updated smb.conf and smbusers files are appended.


The man page for cupsaddsmb should be updated with this information as it seems that this has been a problem for a lot of people.

Paul McIlfatrick

This is the ammended smb.conf file:

# Date: 2008-05-14
   workgroup = bec
   server string = Printhost01
   printing = cups
   printcap name = cups
   printcap cache time = 750
   cups options = raw
   security = user
   username map = /etc/samba/smbusers
   netbios aliases = printers
   netbios name = printhost01
   encrypt passwords = yes
   passdb backend = smbpasswd
#  wins server =
## wins server =
   wins support = no
   domain master = no
   map to guest = Bad User

   comment = All Printers
   path = /var/tmp
   browseable = no
   public = yes
   guest ok = yes
   printable = yes
   writable = yes

   comment = Printer Drivers
   path = /etc/samba/drivers
   browseable = yes
   guest ok = no
   read only = yes
   write list = root

This is the ammended smbusers file:

root = administrator admin

foo = *

More information about the cups mailing list