- Printing to a Linux/CUPS/Samba printer from Windows machines
- Posted by Balwinder Singh Dheeman on January 26th, 2004
Hello friends,
On my Redhat Linux 9.0 machine, I cureently have:
cups-1.1.17-13.3
samba-2.2.7a-7.9.0
and things are working fine for my Epson Stylus COLOR 740 printer
attatched to this Linux machine.
I and, or other users on my network from Windows machines can see and,
or browse this printer, but can't access it from Windows printer
manager. Error message displayed in title bar is:
lp0 on sun, Access denied, unable to connect
Though, we can print any text documents to our Linux printer by
redirecting output from windows command prompt to it:
C:\> type textout.txt >//sun/lp0
I'm unable to figure out, how do I install installable printer drivers
for Windows machines on Linux/CUPS/Samba server, though searched a lot
in the CUPS and Samba docs, but to a no avail.
Anyone there who can point me to a mini-HOWTO and, or HOWTO?
Regards
--
Dr Balwinder Singh Dheeman
"Linux is much much better, but in not the best as yet.
Do you too work on making a difference?"
- Posted by Matt Payton on January 27th, 2004
On Mon, 26 Jan 2004 21:26:04 +0530, Balwinder Singh Dheeman wrote:
Might be easier to troubleshoot if you included the relevant sections of
your smb.conf, and any entries in the logs...
http://us1.samba.org/samba/docs/man/...html#id2927201
Note that this is for Samba 3.x...May or may not apply for Samba 2.x, and
you don't say what version you're running.
Actually, the entire doc at the above URL is one of the best overall
sources on Samba that I've seen. Of course it is by one of the Samba
authors. So good I had to buy a hardcopy of it...
--
- Matt -
- Posted by Balwinder Singh Dheeman on January 27th, 2004
Matt Payton wrote:
It worked well for me on many of my installations, I then was using
LPrng. I
switched over to CUPS now. Here is my smb.conf for your kind reference:
####
# settings that I customized, in my /etc/smb.conf
#======================= Global Settings
=====================================
[global]
# workgroup = NT-Domain-Name or Workgroup-Name
workgroup = UNIVERSE
# if you want to automatically load your printer list rather
# than setting them up individually then you'll need this
load printers = yes
printcap name = cups
# It should not be necessary to spell out the print system type unless
# yours is non-standard. Currently supported print systems include:
# bsd, sysv, plp, lprng, aix, hpux, qnx, cups
printing = cups
# Security mode. Most people will want user level security. See
# security_level.txt for details.
security = USER
# You may wish to use password encryption. Please read
# ENCRYPTION.txt, Win95.txt and WinNT.txt in the Samba documentation.
# Do not enable this option unless you have read those documents
encrypt passwords = yes
smb passwd file = /etc/samba/smbpasswd
# The following is needed to keep smbclient from spouting spurious errors
# when Samba is built with support for SSL.
; ssl CA certFile = /usr/share/ssl/certs/ca-bundle.crt
# The following are needed to allow password changing from Windows to
# update the Linux system password also.
# NOTE: Use these with 'encrypt passwords' and 'smb passwd file' above.
# NOTE2: You do NOT need these to allow workstations to change only
# the encrypted SMB passwords. They allow the Unix password
# to be kept in sync with the SMB password.
unix password sync = Yes
passwd program = /usr/bin/passwd %u
passwd chat = *New*password* %n\n *Retype*new*password* %n\n
*passwd:*all*authentication*tokens*updated*success fully*
# You can use PAM's password change control flag for Samba. If
# enabled, then PAM will be used for password changes when requested
# by an SMB client instead of the program listed in passwd program.
# It should be possible to enable this without changing your passwd
# chat parameter for most setups.
pam password change = yes
# Unix users can map to different SMB User names
username map = /etc/samba/smbusers
# This parameter will control whether or not Samba should obey PAM's
# account and session management directives. The default behavior is
# to use PAM for clear text authentication only and to ignore any
# account or session management. Note that Samba always ignores PAM
# for authentication in the case of encrypt passwords = yes
obey pam restrictions = yes
# Most people will find that this option gives better performance.
# See speed.txt and the manual pages for details
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
# Browser Control Options:
# set local master to no if you don't want Samba to become a master
# browser on your network. Otherwise the normal election rules apply
local master = yes
# Windows Internet Name Serving Support Section:
# WINS Support - Tells the NMBD component of Samba to enable it's WINS
Server
wins support = yes
# DNS Proxy - tells Samba whether or not to try to resolve NetBIOS names
# via DNS nslookups. The built-in default for versions 1.9.17 is yes,
# this has been changed in version 1.9.18 to no.
dns proxy = no
#============================ Share Definitions
==============================
[homes]
comment = Home Directories
browseable = no
writable = yes
valid users = %S
create mode = 0664
directory mode = 0775
# NOTE: If you have a BSD-style print system there is no need to
# specifically define each individual printer
[printers]
comment = All Printers
path = /var/spool/samba
browseable = no
public = yes
guest ok = yes
writable = no
printable = yes
printer admin = root
####
# additions that I made, in my /etc/smb.conf
# ================================ Local Shares
==============================
[print$]
comment = Printer drivers for Windows clients
path = /var/lib/samba/drivers
browseable = Yes
guest ok = No
read only = Yes
write list = root
[a]
comment = Read/writable floppy disk A:
path = /misc/floppy
read only = No
guest ok = Yes
[c]
comment = Readonly disk/partition C:
path = /misc/c
guest ok = Yes
[cdrom]
comment = Readonly cd-rom disk
path = /misc/cdrom
guest ok = Yes
[d]
comment = Readonly disk/partition D:
path = /mnt/d
guest ok = Yes
[e]
comment = Readonly disk/partition E:
path = /misc/e
guest ok = Yes
[f]
comment = Readonly disk/partition F:
path = /misc/f
guest ok = Yes
[tmp]
comment = Read/writable subdirectory
path = /var/tmp
read only = No
guest ok = Yes
####
# eof
and the log entries (errors and, or messages I read in my current log
files):
[2004/01/26 20:57:48, 0] printing/print_cups.c:cups_job_submit(655)
Unable to print file to lp0 - client-error-document-format-not-supported
[2004/01/27 02:14:30, 0] printing/print_cups.c:cups_printername_ok(291)
Unable to get printer status for
::{2227a280-3aea-1069-a2de-08002b30309d} - client-error-not-found
[2004/01/27 02:14:30, 0] smbd/service.c:make_connection(252)
cto (203.152.135.66) couldn't find service
::{2227a280-3aea-1069-a2de-08002b30309d}
[2004/01/27 02:23:02, 0] printing/print_cups.c:cups_job_submit(655)
Unable to print file to lp0 - client-error-document-format-not-supported
Please not that we can print, but only text files to this shared
Linux/CUPS/Samba printer.
It was/is there, see above. I've samba-2.2.7a-7.9.0; the docs read there
was some problem in 2.2.0 for Windows 2000/XP cleints, but was bugfixed
in 2.2.1 onward.
Thanks a lot!
--
Dr Balwinder Singh Dheeman
http://anu.homelinux.net/~bsd/
"Linux is much much better, but in not the best as yet.
Do you too work on making a difference?"
- Posted by Matt Payton on January 27th, 2004
Balwinder Singh Dheeman wrote:
[...]
So, just to confirm, you manually loaded the print drivers on the pc(s)
you're printing from ?
If so, try creating a printer on Linux that is basically a plain text
printer, and map the Win machines to that...It looks to me that Windows
is formatting the print job with it's driver, the job is getting to
CUPS, and the CUPS driver is rejecting it...This is over-simplified.
Anyway, I'm not all that familiar with CUPS, but when using either bsd
lpr or LPRng I typically set up 2 spools for each individual
printer...One for printing from *nix, and one for printing from Win
machines. The one for printing from Win has no filter associated with
it, so it just passes the raw data to the printer...This works because
they are already "formatted" by the Windows drivers.
So a typical entry in /etc/printcap looks something like :
lp:\
mx#0:\
sd=/var/spool/lpd/lp:\
sh:lp=/dev/lpt0:\
if=/usr/local/libexec/if-simple:
lpwin:\
mx#0\
:sd=/var/spool/lpd/lpwin:\
sh:\
sf:\
lp=/dev/lpt0:
There are of course other ways of getting this to go, but this has
always worked for me...
--
- Matt -
- Posted by Matt on January 28th, 2004
Balwinder Singh Dheeman wrote:
[...]
Oops...Sorry, missed that the first time.
BTW, while looking for something totally unrelated, I came across this :
http://www.faqs.org/docs/Linux-mini/...re_cups_config
Sounds like it addresses your issue exactly...
--
- Matt -