LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 01-14-2007, 03:28 AM   #1
Electro
Guru
 
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
Trouble Sharing Local Printer using Samba and CUPS for Windows systems


Having problems setting up my printer to share to other computers that are running Windows 2000 and Windows XP. I extracted CUPS version 6 Windows 2000/XP drivers to /usr/share/cups/drivers. The printer is Brother HL-5140. I used the hl1250 ppd file from http://openprinting.org/show_printer...rother-HL-5140. I am using CUPS version 1.2.6 and Samba version 3.0.22. The printer works locally with out any trouble, but I would like to set it up to accept print jobs from other computers on my network.

As root I typed cupsaddsmb -U root -a -v
Code:
Running command: smbclient ///var/run/cups/cups.sock/print$ -N -A /var/spool/cups/tmp/45a9e7592d303 -c 'mkdir W32X86;put /var/spool/cups/tmp/45a9e75631a95 W32X86/BrotherHL5140.ppd;put /usr/share/cups/drivers/ps5ui.dll W32X86/ps5ui.dll;put /usr/share/cups/drivers/pscript.hlp W32X86/pscript.hlp;put /usr/share/cups/drivers/pscript.ntf W32X86/pscript.ntf;put /usr/share/cups/drivers/pscript5.dll W32X86/pscript5.dll'
Connection to  failed

Unable to copy Windows 2000 printer driver files (1)!
/etc/cups/cups.conf
Code:
# Show troubleshooting information in error_log.
LogLevel debug2

SystemGroup lpadmin
# Allow remote access
Port *:631
Listen /var/run/cups/cups.sock

# Enable printer sharing and shared printers.
Browsing On
BrowseOrder allow,deny
BrowseAllow ALL
BrowseAddress @LOCAL

DefaultAuthType Basic

<Location />
  # Allow shared printing...
  Order allow,deny
  Allow @LOCAL
</Location>
<Location /admin>
  Encryption Required
  # Restrict access to the admin pages...
  Order allow,deny
  Allow localhost
</Location>
<Location /admin/conf>
  AuthType Basic
  Require user @SYSTEM
  # Restrict access to the configuration files...
  Order allow,deny
  Allow localhost
</Location>
<Policy default>
  <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job CUPS-Move-Job>
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>
  <Limit Pause-Printer Resume-Printer Set-Printer-Attributes Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After CUPS-Add-Printer CUPS-Delete-Printer CUPS-Add-Class CUPS-Delete-Class CUPS-Accept-Jobs CUPS-Reject-Jobs CUPS-Set-Default>
    AuthType Basic
    Require user @SYSTEM
    Order deny,allow
  </Limit>
  <Limit CUPS-Authenticate-Job>
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>
  # Only the owner or an administrator can cancel a job...
  <Limit Cancel-Job>
    Order deny,allow
    Require user @OWNER @SYSTEM
  </Limit>
  <Limit All>
    Order deny,allow
  </Limit>
</Policy>
/etc/samba/smb.conf
Code:
[global]
workgroup = HOME
load printers = yes
printing = CUPS
printcap name = cups
#use client driver = yes
log file = /var/log/samba/%m.log
max log size = 50
#map to guest = bad user
security = user
encrypt passwords = yes
#smb passwd file = /etc/samba/smbpasswd
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
hosts allow = 192.168.1.* EXCEPT 192.168.1.1

[homes]
comment = Home Directories
browseable = no
writable = yes

[public]
   comment = Everybody can read and write
   path = /media-A/public
   public = yes
   only guest = yes
   writable = yes
   printable = no
   browseable = yes
   only guest = yes
   force directory mode = 0777
   force create mode = 0666
   guest ok = yes
   create mask = 0666
   force directory security mode = 0777
   max disk size = 1000


[printers]
comment = All Printers
 path = /etc/samba/drivers
 browseable = no
 guest ok = yes
 writable = no
 printable = yes
 printer admin = root
# create mode = 0777
# print command = lpr -P %p -o raw %s
# use client driver = yes
# printer name = BrotherHL5140

#[printer files]
#comment=
#path=/etc/samba/drivers
#browseable = yes
#guest ok= yes
#writable = no

[print$]
comment = Printer Drivers
path = /etc/samba/printers
browseable = yes
write list = root
guest ok = no
read only = yes
#inherit permissions = yes
rpcclient -Uroot%XXXX -c 'enumprinters' localhost
Code:
        flags:[0x800000]
        name:[\\thejunky\BrotherHL5140]
        description:[\\thejunky\BrotherHL5140,BrotherHL5140,Brother HL5140]
        comment:[Brother HL5140]
ls -l /usr/share/cups/drivers
Code:
-rw-rw-r--  1 root lp    803 Jun 17  2005 cups6.inf
-rw-rw-r--  1 root lp     72 Jun 17  2005 cups6.ini
-rw-rw-r--  1 root lp   9529 Jun 17  2005 cups6.ppd
-rw-rw-r--  1 root lp  12568 Jun 17  2005 cupsps6.dll
-rw-rw-r--  1 root lp  13672 Jun 17  2005 cupsui6.dll
-rw-r--r--  1 root lp   6136 Jan 13 00:46 msgencol.bpd
-rw-r--r--  1 root lp   3532 Jan 13 00:46 msgencol.ppd
-rw-r--r--  1 root lp 132608 Jan 13 00:46 ps5ui.dll
-rw-r--r--  1 root lp  26038 Jan 13 00:46 pscript.hlp
-rw-r--r--  1 root lp 792644 Jan 13 00:46 pscript.nif
-rw-r--r--  1 root lp 464384 Jan 13 00:46 pscript5.dll
I tried doing "Manual Driver Installation in 15 Steps" at http://www.samba.org/samba/docs/man/...-printing.html, but problems occur when I get to step 4.

Also when kprinter tries to access /var/run/cups/cups.sock, it produces an error that states:
Code:
Connection to CUPS server failed. Check that the CUPS server is correctly installed and running. Error: Host not found.
I do not use KDE as my destop/window manager.
 
Old 01-15-2007, 03:06 AM   #2
Electro
Guru
 
Registered: Jan 2002
Posts: 6,042

Original Poster
Rep: Reputation: Disabled
Can anybody help me.
 
Old 01-16-2007, 12:17 AM   #3
Electro
Guru
 
Registered: Jan 2002
Posts: 6,042

Original Poster
Rep: Reputation: Disabled
I have made some progress.

I manually add a printer using the following steps
1) Share CUPS 6 for Windows 2000/XP drivers using Samba
2) Boot up in Windows and log into an administrator account
3) In Windows, select Printers and Faxes in the settings menu
4) Then select Add Printers and Faxes
5) Select Network Printers
6) In the URL box (usually the third option), type http://192.168.1.101:631/printers/BrotherHL5140
7) When Add Driver menu comes up, click Have Disk...
8) Access the directory or shares where CUPS 6 for Windows 2000/XP installation files are stored
9) Select cups6.inf and click OK
10) Click continued to resume driver installation when it says CUP 6 is not digitally signed by Microsoft
11) Either print a test page or visit a favorite site and print

Depending on the settings that I setup in CUPS on the Linux host, the print out quality will be the same. I also set Windows, so it sends it to my Linux box to spool instead of first spooling it on Windows.

cat /etc/cups/cupsd.conf
Code:
# Show troubleshooting information in error_log.
LogLevel debug
SystemGroup lpadmin
# Allow remote access
Port *:631
Listen /var/run/cups/cups.sock
# Enable printer sharing and shared printers.
Browsing On
BrowseOrder allow,deny
BrowseAllow @LOCAL
BrowseAddress @LOCAL
DefaultAuthType Basic
<Location />
  # Allow shared printing and remote administration...
  Order allow,deny
  Allow @LOCAL
</Location>
<Location /admin>
  Encryption Required
  # Allow remote administration...
  Order allow,deny
  Allow @LOCAL
</Location>
<Location /admin/conf>
  AuthType Basic
  Require user @SYSTEM
  # Allow remote access to the configuration files...
  Order allow,deny
  Allow @LOCAL
</Location>
<Policy default>
  <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job CUPS-Move-Job>
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>
  <Limit Pause-Printer Resume-Printer Set-Printer-Attributes Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After CUPS-Add-Printer CUPS-Delete-Printer CUPS-Add-Class CUPS-Delete-Class CUPS-Accept-Jobs CUPS-Reject-Jobs CUPS-Set-Default>
    AuthType Basic
    Require user @SYSTEM
    Order deny,allow
  </Limit>
  <Limit CUPS-Authenticate-Job>
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>
  # Only the owner or an administrator can cancel a job...
  <Limit Cancel-Job>
    Order deny,allow
    Require user @OWNER @SYSTEM
  </Limit>
  <Limit All>
    Order deny,allow
  </Limit>
</Policy>
cat /etc/cups/printers.conf
Code:
<DefaultPrinter BrotherHL5140>
Info Brother HL-5140 (BW Laser)
Location Local USB Printer
DeviceURI usb://Brother/HL-5140%20series
State Idle
StateTime 1168911898
Accepting Yes
Shared Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
OpPolicy default
ErrorPolicy stop-printer
</Printer>
Telling Samba where the drivers for the printer is a different story. Again I would like to use CUPS 6 for Windows 2000/XP. I tried typing:
Code:
rpcclient localhost -Uroot%XXXX -c 'adddriver "Windows NT x86" "BrotherHL5140:pscript5.dll:cups6.ppd:ps5ui.dll:pscript.hlp:NULL:RAW:pscript.ntf,cups6.ini,cupsps6.dll,cupsui6.dll"'
It prints "WERR_UNKNOWN_PRINTER_DRIVER". I do not mind doing the steps to add a printer in Windows, but I would like to get the Point 'n Click feature working in Samba.

Can anybody help me!
 
Old 01-17-2007, 09:54 PM   #4
Electro
Guru
 
Registered: Jan 2002
Posts: 6,042

Original Poster
Rep: Reputation: Disabled
Please, anybody help me.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
sharing CUPS printer with SAMBA shellcode Linux - General 14 07-30-2005 09:15 AM
CUPS error - trouble printing to windows printer vr6stress Linux - Newbie 13 12-23-2004 08:46 AM
Samba printer sharing and CUPS subaruwrx Linux - Networking 5 08-27-2004 11:37 AM
CUPS windows printer sharing - Connection Refused dafatdude Linux - Networking 1 06-06-2004 04:44 PM
Sharing files with windows systems using samba ashpai Linux - Networking 3 02-28-2001 11:21 PM


All times are GMT -5. The time now is 05:03 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration