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@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@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@phy.syr.edu > Systems Administrator/Manager > Department of Physics > Syracuse University, Syracuse, NY > > >
(original message below) Thanks for your help... I've been trying to get a client printer hanging off a w95 box to print from unix/samba share and it does nothing... I've tried direcly, the command /usr/local/samba/bin/smbclient \\\\machine\\printershare -N -c 'print <postscriptfile>' > /dev/null (all one line) and without the > /dev/null it gives error:>Added interface ip=128.230.27.1 bcast=128.230.27.255 nmask=255.255.255.0 >Session request failed (131,130) with myname=SERVER destname=WORKSTUDY >Called name not present >Try to connect to another name (instead of WORKSTUDY) >You may find the -I option useful for thisso I try using the IP with a -I and putting the IP address as the machinename and it doesn't output anything. The printer is shared with full access. (I assume that means no username or password) Any suggestions? Thanks! Dan At 10:17 PM 9/14/98 +0200, you wrote:>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@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@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@phy.syr.edu >> Systems Administrator/Manager >> Department of Physics >> Syracuse University, Syracuse, NY >> >> >> >-------------------------------------------------------------------------- Dan Kirkpatrick dkirk@phy.syr.edu Systems Administrator/Manager Department of Physics Syracuse University, Syracuse, NY http://www.phy.syr.edu/~dkirk Fax: (315) 443-9103 Personal: http://www.geocities.com/heartland/6540/ --------------------------------------------------------------------------
(original message below) Thanks for your help... I've been trying to get a client printer hanging off a w95 box to print from unix/samba share and it does nothing... I've tried direcly, the command /usr/local/samba/bin/smbclient \\\\machine\\printershare -N -c 'print <postscriptfile>' > /dev/null (all one line) and without the > /dev/null it gives error:>Added interface ip=128.230.27.1 bcast=128.230.27.255 nmask=255.255.255.0 >Session request failed (131,130) with myname=SERVER destname=WORKSTUDY >Called name not present >Try to connect to another name (instead of WORKSTUDY) >You may find the -I option useful for thisso I try using the IP with a -I and putting the IP address as the machinename and it doesn't output anything. The printer is shared with full access. (I assume that means no username or password) Any suggestions? Thanks! Dan At 10:17 PM 9/14/98 +0200, you wrote:>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@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@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@phy.syr.edu >> Systems Administrator/Manager >> Department of Physics >> Syracuse University, Syracuse, NY >> >> >> >-------------------------------------------------------------------------- Dan Kirkpatrick dkirk@phy.syr.edu Systems Administrator/Manager Department of Physics Syracuse University, Syracuse, NY http://www.phy.syr.edu/~dkirk Fax: (315) 443-9103 Personal: http://www.geocities.com/heartland/6540/ --------------------------------------------------------------------------