5

I have an old desktop that I'm trying to set up as a home backup/print server. Backup was trivial, but am having issues getting the printing to work. The printer is connected to the server running Ubuntu Server 9.10 (no gui). If I access the printer via http://hostname:631/printers/, I am able to print a test page, so I know the printer is working; however, I am having no luck from Windows.

Windows can see the printer when browsed via \hostname\, but I am unable to connect. Windows says "Windows cannot connect to the printer" without indicating why.

Any suggestions?

From /etc/samba/smb.conf:

[global]
   workgroup = WORKGROUP
   dns proxy = no
   security = user
   username map = /etc/samba/smbusers
   encrypt passwords = true
   passdb backend = tdbsam
   obey pam restrictions = yes
   unix password sync = yes
   passwd program = /usr/bin/passwd %u
   passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
   pam password change = yes
   map to guest = bad user
   load printers = yes
   printing = cups
   printcap name = cups

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

[print$]
   comment = Printer Drivers
   path = /var/lib/samba/printers
   browseable = yes
   read only = yes
   guest ok = yes

From /etc/cups/cupsd.conf:

LogLevel warn
SystemGroup lpadmin
Port 631
Listen /var/run/cups/cups.sock
Browsing On
BrowseOrder allow,deny
BrowseAllow all
BrowseRemoteProtocols CUPS
BrowseAddress @LOCAL
BrowseLocalProtocols CUPS dnssd
DefaultAuthType Basic
<Location />
  Order allow,deny
  Allow all
</Location>
<Location /admin>
  Order allow,deny
  Allow all
</Location>
<Location /admin/conf>
  AuthType Default
  Require user @SYSTEM
  Order allow,deny
  Allow all
</Location>
<Policy default>
    <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job CUPS-Move-Job CUPS-Get-Document>
        Require user @OWNER @SYSTEM
        Order deny,allow
    </Limit>
    <Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default CUPS-Get-Devices>
        AuthType Default
        Require user @SYSTEM
        Order deny,allow
    </Limit>
    <Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After CUPS-Accept-Jobs CUPS-Reject-Jobs>
        AuthType Default
        Require user @SYSTEM
        Order deny,allow
    </Limit>
    <Limit CUPS-Authenticate-Job>
        Require user @OWNER @SYSTEM
        Order deny,allow
    </Limit>
    <Limit All>
        Order deny,allow
    </Limit>
</Policy>
<Policy authenticated>
    <Limit Create-Job Print-Job Print-URI>
        AuthType Default
        Order deny,allow
    </Limit>
    <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job CUPS-Move-Job CUPS-Get-Document>
        AuthType Default
        Require user @OWNER @SYSTEM
        Order deny,allow
    </Limit>
    <Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default>
        AuthType Default
        Require user @SYSTEM
        Order deny,allow
    </Limit>
    <Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After CUPS-Accept-Jobs CUPS-Reject-Jobs>
        AuthType Default
        Require user @SYSTEM
        Order deny,allow
    </Limit>
    <Limit Cancel-Job CUPS-Authenticate-Job>
        AuthType Default
        Require user @OWNER @SYSTEM
        Order deny,allow
    </Limit>
    <Limit All>
        Order deny,allow
    </Limit>
</Policy>

5 Answers 5

1

You need to add a guest user to the samba password database. Usually it is done by mapping guest in samba configuration files to a UNIX existing user; give that user printing rights via groups; then you should be able to access the printer via the \\server\ URI.

You can try also connecting to the server by supplying a username (i.e. administrator) when adding a network drive.

2
  • terribly sorry to resurrect an old post, but I have this exact problem and can't figure out what your answer means. I'd love it if you could explain on my new post superuser.com/questions/1081542/…
    – Blaine
    May 28, 2016 at 9:17
  • 1
    @Blaine wow that was a long time ago :) Seems like the (only) answer to your question is correct: you need to add a new user. I'll comment over there.
    – lorenzog
    May 28, 2016 at 17:52
2

When printing from Windows to a CUPS server, I found it more reliable to use IPP (Internet Printing Protocol) rather than SMB.

In Windows, when adding a new printer, choose "Network Printer", then "Connect to printer on the Internet or your intranet".

When it asks for printer URL, input http :// hostname:631/printers/printername (remove spaces from this URL, I've added them due to Superuser.com's hyperlink count limit for new users).

Then proceed as usual.

See also this 3-part howto for setting up the CUPS server, printer drivers and Windows client:

http://www.howtoforge.com/ipp_based_print_server_cups

1
  • Thing is, windows is dog slow when it comes to IPP.
    – LiraNuna
    Feb 25, 2010 at 11:37
0

Did you upgrade to 9.10 (Karmic)?

On the thread here, people mention that once they upgraded from Jaunty to Karmic they had to repeat the printer server instructions before XP could connect the printer again.

Maybe that will help you?

1
  • I did not upgrade to 9.10. It was a fresh install of 9.10. The 9.04 instructions don't really help because they assume I'm running Ubuntu Desktop, which I'm not. I'm running Ubuntu Server, so no GUI Feb 5, 2010 at 7:26
0

I'm not currently using Samba, but I've still got a few suggestions:

  • enable logging by adding log file = /var/log/samba.log to /etc/samba/smb.conf - it might give you clues as to what is going wrong (you can also set log level = 10, giving you much more output)

  • writable = no and read only = yes really are the same, so you should remove one of them - otherwise, changing only one of them alone might have no effect

  • try changing create mask to its default 0744

  • finally, if all of this didn't work out, have a look at the documentation: http://localhost:631/ (didn't know myself that this was "online"...) and man smb.conf

Good luck!

1
  • i've got an ubuntu system whose default smb.conf uses create mask = 0700 in the printers share definition, so i'd assume that setting is sane. Feb 15, 2010 at 7:40
0

If the printer is working in Linux, perhaps Linux is a red herring?

I read an article on Microsoft TechNet from someone who has a similar problem as yours. Supposing that Samba and Linux are a red herring in this case, it might be worth trying the proposed solution.

You must log in to answer this question.

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