Networking Forums

Networking Forums > Computer Networking > Linux Networking > Printing from Linux (lprng) to a shared printer on a Windows host

Reply
Thread Tools Display Modes

Printing from Linux (lprng) to a shared printer on a Windows host

 
 
Jem Berkes
Guest
Posts: n/a

 
      05-22-2004, 07:58 PM
[ 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/
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Shared printer not printing Scarletangel Wireless Networks 0 04-04-2006 05:41 AM
Printing to a WinXP Shared Printer Richard Balaban Wireless Networks 1 12-16-2004 08:47 AM
Printing from XP pro to shared printer on Win98se =?Utf-8?B?TWFyayBE?= Windows Networking 1 11-29-2004 03:31 PM
Printing to Shared Printer from Networked Windows 95 PC Ron Holzer Broadband Hardware 1 02-20-2004 05:10 AM
Printing on shared Windows Printer Jamie Williams Linux Networking 9 12-15-2003 06:01 PM



1 2 3 4 5 6 7 8 9 10 11