|
||||||||
|
|
|||||||
![]() |
|
|
Thread Tools | Display Modes |
|
#1
|
|
[ Decided to plant this info on USENET for whoever might find it useful ]
[ In Slackware, this is the easiest way to print to a Windows printer ] Goal: Printing from Linux (lprng) to a shared printer on a Windows host I'm using Slackware 9.1, and the following are required: + lprng + samba (smbclient and smbprint script; not as a server) + Working printer/account on Windows host (printer share) If the printer connected to the Windows host supports Postscript, this makes things really easy because the following configuration will immediately allow just about all printing under Linux -- I've tried Mozilla Firefox browser, OpenOffice.org, Gnome Ghostscript and all were able to print from default install! I have a HP LaserJet 1200. 1. Modify /etc/printcap # HP LaserJet 1200 laserjet:cm=HP LaserJet 1200 :lp=/dev/null :sd=/var/spool/lpd/laserjet :if=/var/spool/lpd/laserjet/smbprint :sh:sf: 2. Create spool subdirectory for remote printer Create /var/spool/lpd/printername (arbitrary subdirectory for the printer share you want to use). In Slackware make sure user lp can create files under this directory. 3. Install and configure smbprint The shell script "smbprint" is provided under Samba's examples. Make sure the script is executable, and is in the location pointed to by ":if=" in /etc/printcap. You'll probably have to modify smbprint to point to smbclient on your system. Create smbprint's configuration file, which is ".config" in the same directory as smbprint. This configuration file contains all information required to access the shared printer on the Windows host: server=COMPUTER_NAME service=PrinterName username=printuser password=printpass 4.Test/debug configuration Restart lpd and make sure the printer is running with "lpc up". Also, "lpq" should show the local print queue. You should now be able to send jobs to the printer on your Windows host using "lpr" from Linux. I encountered a number of problems. The first was a permissions issue that made it impossible to create print jobs under /var/spool/lpd/laserjet so make sure you check syslog for lprng-generated I/O error messages. My next problem was that smbclient itself wasn't executing; double-check the smbprint script being invoked by /etc/printcap and make sure that the script refers to a valid smbclient binary. Even after my smbclient was executing and communicating with the print server (confirmed using tcpdump to monitor SMB traffic between Linux and Windows), the print jobs still weren't going through. This turned out to be an authentication problem. I created a new account on our Windows 2000 host to allow printing from Linux. Otherwise, anonymous print jobs were being denied. -- Jem Berkes http://www.sysdesign.ca/ Jem Berkes |
![]() |
| Tags |
| host, linux, lprng, printer, printing, shared, windows |
| Thread Tools | |
| Display Modes | |
|
|