Networking :: Problems using samba to share printers



In fact the main mistake I was making after modifying smb.conf was:
Code Sample
$ smbd restart
$ nmbd restart

should have been

$ sudo smbd restart
$ sudo nmbd restart
aaargh - you'd think there'd be an error message.

Now things look more promising:
Code Sample
$ /opt/hplip/sbin/cupsaddsmb -H localhost -U root -a -v
Password for root required to access localhost via SAMBA:
Running command: smbclient //localhost/print$ -N -A /tmp/46d86d9748516 -c 'mkdir W32X86;put /tmp/46d86d922450d W32X86/OfficeJetG85.ppd;put /opt/hplip/share/cups/drivers/ps5ui.dll W32X86/ps5ui.dll;put /opt/hplip/share/cups/drivers/pscript.hlp W32X86/pscript.hlp;put /opt/hplip/share/cups/drivers/pscript.ntf W32X86/pscript.ntf;put /opt/hplip/share/cups/drivers/pscript5.dll W32X86/pscript5.dll'
Domain=[DSLKAYAK] OS=[Unix] Server=[Samba 3.0.25b]
putting file /tmp/46d86d922450d as \W32X86/OfficeJetG85.ppd (2943.0 kb/s) (average 2943.0 kb/s)
putting file /opt/hplip/share/cups/drivers/ps5ui.dll as \W32X86/ps5ui.dll (1660.3 kb/s) (average 1779.6 kb/s)
putting file /opt/hplip/share/cups/drivers/pscript.hlp as \W32X86/pscript.hlp (908.1 kb/s) (average 1565.5 kb/s)
putting file /opt/hplip/share/cups/drivers/pscript.ntf as \W32X86/pscript.ntf (3486.8 kb/s) (average 2834.9 kb/s)
putting file /opt/hplip/share/cups/drivers/pscript5.dll as \W32X86/pscript5.dll (3978.1 kb/s) (average 3124.5 kb/s)

Running command: smbclient //localhost/print$ -N -A /tmp/46d86d9748516 -c 'put /opt/hplip/share/cups/drivers/cups6.ini W32X86/cups6.ini;put /opt/hplip/share/cups/drivers/cupsps6.dll W32X86/cupsps6.dll;put /opt/hplip/share/cups/drivers/cupsui6.dll W32X86/cupsui6.dll'
Domain=[DSLKAYAK] OS=[Unix] Server=[Samba 3.0.25b]
putting file /opt/hplip/share/cups/drivers/cups6.ini as \W32X86/cups6.ini (3.1 kb/s) (average 3.1 kb/s)
putting file /opt/hplip/share/cups/drivers/cupsps6.dll as \W32X86/cupsps6.dll (2454.6 kb/s) (average 440.8 kb/s)
putting file /opt/hplip/share/cups/drivers/cupsui6.dll as \W32X86/cupsui6.dll (2225.2 kb/s) (average 755.7 kb/s)

Running command: rpcclient localhost -N -A /tmp/46d86d9748516 -c 'adddriver "Windows NT x86" "OfficeJetG85:pscript5.dll:OfficeJetG85.ppd:ps5ui.dll:pscript.hlp:NULL:RAW:pscript5.dll,OfficeJetG85.ppd,ps5ui.dll,pscript.hlp,pscript.ntf,cups6.ini,cupsps6.dll,c

upsui6.dll"'
Printer Driver OfficeJetG85 successfully installed.

Running command: rpcclient localhost -N -A /tmp/46d86d9748516 -c 'setdriver OfficeJetG85 OfficeJetG85'
Succesfully set OfficeJetG85 to driver OfficeJetG85.

Now - finally - windows machines can see a shared folder on my dsl desktop and they can see the printer and download the drivers automatically on double-clicking the printer icon.

Edit: note that for the above to work, security has to be set to "user" in smb.conf. Once the windows machine has downloaded the printer drivers, security can be reset to "share"

...trouble is, the windows machines cannot copy a file to the dsl share nor does anything print. Back to reading the samba manual  :(

I've now got to the point where:

1. Both a w2k and an xp machine can read and write to a share mounted on a dsl machine (when they mount the share as root).
2a. The w2k machine can see a printer on the dsl machine but gives an "access denied" error when I try to add the printer.
2b. The xp machine installs the printer on the dsl machine but gives an "access denied" error when I try to print.

I would like the windows machines to access the printer on the dsl machine without the need for a username or password (in any case I don't believe windows would ask for a password when trying to add a printer).

Does anyone know where I'm going wrong from the conf files below?

smb.conf:
Code Sample
[global]
workgroup = JUANITO
netbios name = DSLKAYAK
hosts allow = 192.168.1.
security = share
load printers = yes
printing = cups
printcap name = cups

[share]
path = /mnt/sdb4/dslshare
read only = no
browseable = yes
guest ok = yes

[printers]
comment = All Printers
path = /var/spool/samba
browseable = yes
public = yes
guest ok = yes
writable = no
printable = yes

[print$]
comment = Printer Drivers
path = /opt/hplip/share/cups/drivers
browseable = yes
guest ok = no
read only = yes
write list = root


cupsd.conf:
Code Sample
LogLevel info
Port 631
Listen /opt/hplip/var/run/cups/cups.sock
Browsing On
BrowseAddress 192.168.1.255

<Location />
 Order Deny,Allow
 Deny From None
 Allow From 192.168.1.*
 Allow From 127.0.0.1
</Location>

<Location /admin>
 AuthType Basic
 AuthClass System
 Allow From 127.0.0.1
 Order Deny,Allow
 Deny From All
</Location>

hmm - seems the solution was as simple (or obscure) as:
Code Sample
$ sudo chown -R dsl /var/spool/samba
$ chgrp -R staff /var/spool/samba
$ chmod 777 /var/spool/samba
$ cmod o+t /var/spool/samba

This allows an xp box to print to a printer shared by my dsl desktop, and now onto sharing the scanner...

Juanito,
looks like you had lots of fun with this.  Im re tracing your steps trying to achive the same goal, but Im a little confused.  I dont suppose you managed to bullet point what you did from the beginning to create some sort of simple "howto" to put up here?
just cups, samba and a hp4 driver.

appriciated.

stu

Well, one year on it all still works fine - the cups and samba conf files are posted above, the cups windows driver is in the cups extension - which particular part are you having problems with?

(note also that there is an explanation in the cups-1.3.x.uci and samba-3.uci info files)

Next Page...
original here.