Re: printcap (HP Laserjet 6P) and samba
A long time ago, in a galaxy far, far way, someone said...
> I have a linux box that I'm trying to set up for file & print serving for
> our university administration, but I fear that my ignorance/newbieness is
> causing me some grief, and I'm craving some experienced advice.
>
> Anyone have an example printcap for an HP Laserjet 6P that has been shared
> on a remote Windows printer? This is what I currently have. Anyone see
> anything missing/incorrect? Shouldn't I specify a printer driver somewhere
> if I want to be able to print from the server?
>
> ljsaturn|HP Laserjet 6P
> :rm=saturn.ois.swau.edu
> :rp=hplj6p
> :sd=/var/spool/lpd/ljsaturn
> :mx#0
> :sh
> :sf
If the printer is available only as a SMB share (ie shows up in Network
Neighborhood), then straight LPD won't work.
What you need to do is something like this:
ljsaturn|HP Laserjet 6P
:rm=saturn.ois.swau.edu
:rp=hplj6p
:sd=/var/spool/lpd/ljsaturn
:mx#0
:sh
:sf
:if=/usr/sbin/smbprint-ljsaturn
:lp=/dev/null
smbprint-ljsaturn is a shell script; these are the basics:
#!/bin/sh
logfile=/tmp/smb-print.log
server=saturn
service=hplj6p
password=the-password-if-there-is-one
#
# Some debugging help, change the >> to > if you want to same space.
#
echo "server $server, service $service" >> $logfile
(
# NOTE You may wish to add the line `echo translate' if you want automatic
# CR/LF translation when printing.
# echo translate
echo "print -"
cat
) | /usr/bin/smbclient "\\\\$server\\$service" $password -N -P >> $logfile
I've cut out most of the comments for the sake of brevity; you can find
the original in /usr/doc/samba-doc/examples/printing. Note that this
assumes that the LaserJet is a PostScript printer. If it's not, then
you'll have to do some magic with ghostscript (either the package gs or
gs-alladin) to be able to send PCL to the printer.
> Also, though I've tried to digest the smb.conf documentation, I'm still not
> sure I understand everything. For instance, one of the many questions I have
> is how are passwords managed? Would someone be willing to look my smb.conf
> over?
Sure.
> [global]
> printing = bsd
> printcap name = /etc/printcap
> load printers = yes
> guest account = nobody
> invalid users = root
> security = user
^^^^^^^^^^^^^^^
This is what's called user level security. When the remote system
connects, it _must_ provide a valid Linux username and password to be able
to conenct. In my experience, not a good thing if all you have to connect
with is Win95/Win98 systems (there isn't necessarily any way of
specifiying the username). If you use "security = share", merely a valid
password is needed.
> server string = %h server (Samba %v)
> socket options = IPTOS_LOWDELAY TCP_NODELAY SO_SNDBUF=4096 SO_RCVBUF=4096
> encrypt passwords = yes
> wins support = yes
> os level = 65
> domain master = yes
> domain logons = yes
^^^^^^^^^^^^^
This tells Samba to handle Domain Logons for Win95/98 systems; it's
drastically different from WinNT domains.
> local master = yes
> preferred master = yes
> name resolve order = lmhosts host wins bcast
> dns proxy = no
> mangle case = no
> case sensitive = no
> default case = lower
> preserve case = yes
> short preserve case = yes
> unix password sync = true
^^^^^^^^^^^^^^^^^^
Samba has the ability to syncronize the SMB passwords with the unix
passwords - when they change their password via Samba, their unix password
is automatically updated.
Everything else looks fine to me.
--
----------------------------------------------------------------------
Phil Brutsche pbrutsch@creighton.edu
"There are two things that are infinite; Human stupidity and the
universe. And I'm not sure about the universe." - Albert Einstein
Reply to: