[Samba] Access denied, unable to connect to printer

Kurt Pfeifle kpfeifle at danka.de
Mon Apr 28 13:10:13 GMT 2003


Norman Walsh ndw at nwalsh.com wrote on Samba Digest:

> Sun Apr 27 15:02:56 GMT 2003
> 
> 
> Hello world,
> 
> I've dug through the docs and googled through the net, but I'm still
> unable to fix my Samba (2.2.3a-6 for Debian) setup so that I can print
> from my wife's Windows XP laptop.

Unforch, 2.2.3a is very old, with many known weaknesses in the printing
code.

> The server is using Cups 

Which version of CUPS?

> and I can print from the server and over the
> net from my (Debian) laptop.
> 
> The XP box can connect to the server and browse files (both her home
> directory and other shared directories).
> 
> But the XP box won't connect to the printer on the server.

What is the exact message you are getting on XP? What is the exact
procedure you are using to connect to the printer?

Is it XP Prof or XP Home? Service Packs?

Are you intending to have the driver downloading from the server to the
XP client ?

Or have you installed a driver locally and plan to print "raw" thru
CUPS?

> I'm totally stumped. I set debuglevel=5 in smb.conf and watched the
> log files, but I can't see anything that looks like an error.
> 
> Help?
> 
> Here's my smb.conf:
> 
> [global]
>         debuglevel = 5
> 	server string = Zeus
> 	encrypt passwords = true
> 	obey pam restrictions = Yes
> 	passwd program = /usr/bin/passwd %u
> 	passwd chat = *Enter\snew\sUNIX\spassword:* %n\n *Retype\snew\sUNIX\spassword:* %n\n .
> 	syslog = 0
> 	log file = /var/log/samba/log.%m
> 	max log size = 1000
> 	printcap name = lpstat

??? see below...

> 	domain master = True
> 	dns proxy = No
> 	wins support = Yes
> 	invalid users = root
> 	printing = cups

If "printing = cups" you should also specify "printcap name = cups".
CUPS doesn't need a printcap for itself. But it can generate
one and keep it up to date for the convenience of those 3rd
party apps that need to see a printcap. Check in cupsd.conf
if CUPS writes a printcap ("Princap /etc/printcap" setting).

> 
> [homes]
> 	comment = Home Directories
> 	read only = No
> 	create mask = 0644
> 	directory mask = 0775
> 
> [printers]
> 	comment = All Printers
> 	path = /tmp
> 	read only = No
> 	create mask = 0777
> 	guest ok = Yes
> 	printable = Yes
> 	browseable = No
> 
> [cdrom]
> 	comment = Samba server's CD-ROM
> 	path = /cdrom
> 	guest ok = Yes
> 	locking = No
> 	exec = /bin/mount /cdrom
> 	postexec = /bin/umount /cdrom
> 
> [epson]
> 	comment = Epson CX3200
> 	path = /var/spool/samba
> 	read only = No
> 	create mask = 0777
> 	guest ok = Yes
> 	printable = Yes
> 	print command = lpr -P %p -o raw %s -r
> 	lpq command = lpstat -o %p
> 	lprm command = cancel %p-%j

All these commands will have no effect, if "printing = cups" is
specified and your smbd is linked against libcups.so (check with
"ldd `which smbd` | grep cups").

If you *want* to use your own print commands (also for debugging
reasons), use "printing = sysv" and "printcap name = /etc/printcap"
[or whichever path is appropriate].

> 	printer name = Epson
> 	use client driver = Yes
> 	oplocks = No
> 
> [Music]
> 	path = /share/Music

To troubleshoot the "Access denied", you might want to
look into the "smbstatus" command, which shows *as which
user* Samba is connecting clients to each share.

One final attempt to describe a more complete procedure:

Can you connect with smbclient? Try (from a Linux client):

    smbclient //[SambaIPaddress]/[printersharename] -U root%[password]

You should see s.th. like this:

    added interface ip=10.160.51.60 bcast=10.160.51.255 nmask=255.255.252.0
    Domain=[CUPS-PRINT] OS=[Unix] Server=[Samba 2.2.7a]

    smb: \> put /etc/cups/mime.convs
    putting file /etc/cups/mime.convs as \/etc/cups/mime.convs (17.1 kb/s) (average 17.1 kb/s)
    smb: \> queue
    11489    1024         motd
    11490    1024         motd
    11491    1024         motd
    11492    1024         motd
    11493    1024         motd
    11494    1024         motd
    11495    1024         motd
    11496    1024         motd
    11497    1024         motd
    11498    1024         motd
    11499    1024         motd
    11500    1024         motd
    4        4464         Remote Downlevel Document /mime.convs

Then try

    smbclient //[SambaIPaddress]/[printersharename] -U XPuser%[password]
    smbclient //[SambaIPaddress]/[printersharename] -U guest
    smbclient //[SambaIPaddress]/[printersharename] -U nobody

If this works, install the driver to use your parallel port on Windows XP.
Then try this from the "DOS window" in XP:

    net use lpt1: \\[SambaIPaddress]\[printersharename] -U root%[password]

This would map the parallel port to the Samba share and allow re-direction
of the parallel print jobs to the Samba printer. (You may need to use
"disable spoolss = yes" too...)
>                                         Be seeing you,

When?  ;-)

>                                           norm
> 

Cheers,
Kurt



More information about the samba mailing list