AW: How to print to CLIENT local printer?

Rudolf Kollien Rudolf.Kollien at kollien.de
Mon Sep 14 20:17:42 GMT 1998


You must create a output filter.

Edit /etc/printcap and add your client printer like this:
...
PC-PRINTER:\
:sd=/var/spool/lpd/PP01:\
      :mx#0:\
      :lp=/dev/null:\
:if=/var/spool/lpd/Filter/PP01:\
	:sh:
...
Adjust the printcap parameters as needed (spool directory, directory to find
the filter script). Make sure the lpd can access the directory. Consult your
manual.

Now create the filter script like this:

#! /bin/sh
/usr/bin/smbclient \\\\pcname\\printershare thepasswd -U username -P -c
'print -' > /dev/null

The filter has only two (2) lines. Don't break line two. May be your mail
client wraps the lines!!!
- Change "/usr/bin/smbclient" to the path of your smbclient (maybe
/usr/local/samba/bin ?).
- Change "pcname" to the name of the pc the printer is connected to
- Change "printershare" to the share name of the printer on this pc
- Change "thepasswd" to the password of the share (if you set one. Else use
the "-N" parameter in place of the password).
- If you have user security (like a NT WS or a pc with user level security)
change "username" to a user which has access rights. Else delete the string
"-U username".
- Parameter "-P" instructs smbclient to make a printer connection.
IMPORTANT.
- Parameter "-c ..." specifies the commands which should be executed.
Several commands are separated by ";"

The above script prints files ready for a pc printer. Make sure you create
right formated print files (like linefeed conrtol). If you use windows
output files change "-c .." to: -c 'printmode graphics';'print -'

***IMPORTANT*** As your password can be read in this script use a pc user
with no rights other than printing to the specified printer. Or, without use
level security, do NOT use this user/password on other shares. Make sure the
script can only be read by the lpd damon!!!!!!!!!!!!!!!

Hope this helps..

Regards

System-Consulting Kollien
Rudolf Kollien

Email: kollien at kollien.de
Our home on the net: http://www.kollien.de
***************************************************************************
Never trust a operating system you have no sources for
***************************************************************************
Buying an operating system without source is like buying
a self-assembly Space Shuttle with no instructions.


> -----Ursprüngliche Nachricht-----
> Von: Dan Kirkpatrick [mailto:dkirk at suhep.phy.syr.edu]
> Gesendet am: Montag, 14. September 1998 17:28
> An: Multiple recipients of list
> Betreff: How to print to CLIENT local printer?
>
> How can I setup Samba to be able to print to a client who has a local
> printer, not a network printer?
>
> Thanks!
> Dan
> --------------------------------------------------------------------------
> Dan Kirkpatrick                        dkirk at phy.syr.edu
> Systems Administrator/Manager
> Department of Physics
> Syracuse University, Syracuse, NY
>
>
>



More information about the samba mailing list