Click to See Complete Forum and Search --> : setting up samba to share a printer
anarcholinuxism
07-21-2003, 10:02 AM
I'm trring to set up samba so my other linux box and my xp machine can print to the linux box I've got my printer attached to, below is the relevant part of my samba.conf file. I don't thik it's right!
[printers]
comment = All Printers
path = /tmp
create mask = 0700
guest ok = Yes
printable = Yes
browseable = No
[lp0]
comment = All Printers
path = /tmp
read only = No
create mask = 0700
guest ok = Yes
printable = Yes
printer name = lp0
oplocks = No
I can see the samba linux box on windows "network neighborhood" but not the printer and I don't know what port to use in cups for the other linux box.
mdwatts
07-21-2003, 10:46 AM
Samba is another subject I am not that knowledgeable in.
Anything in http://justlinux.com/nhf/Networks/Samba.html to help or have you tried searching the Networking forum for 'samba printer' etc.? You may find previous threads that will help with the printer setup and configuration.
anarcholinuxism
07-21-2003, 02:05 PM
yes, searched all over before I asked in here :(
I can see my 2 linux boxes from a windows xp machine on my network, both boxes are, as far as I can tell set up identically.
I worked my way methodically through the SWAT interface on both to make sure their smb.conf files matched.
However from the XP box I can access one by double clicking on the icon and see all the files in my home dir, but not the other it prompts me for a username and password and rejects any combination I choose.
Also in the opposite direction if i enter
smbmount //myxpbox/c /mnt/xp
I keep getting prompted for a password but none of my passwords work, root, user or xp account passwords, or no password at all
but if i do the same command from my other linux box (the one that's working properly), all passwords are accepted !!!
There must be something I've missed.
From what you've described, it sounds like an smb user account problem on the wonky Linux box.
Just to make sure I've things straight:
-The Linux box without the printer interacts properly with the XP box.
-The Linux box with the printer cannot be accessed at all from the XP box, and you also can't access the XP machine from this Linux box.
or do I have it wrong?
anarcholinuxism
07-22-2003, 04:37 AM
No you don't have it wrong, and I've just recalled that there is a diffrence between the 2 boxes, I updated the kernel a few months ago on the working one.
And from afew experiments with mount -smbfs this a.m. I'm getting "not supported by the kernel" errors on the non-working box. So I think I've solved my own problem, now to try and remember how I updated the kernel.
anarcholinuxism
07-22-2003, 04:44 PM
well whatever the problems with the kernel it hasn't solved my probelm
Today I have managed to delete /etc/printcap on the working server samba
and delete smb.conf from the non-working one (although I sem to have bben able to rewrite a default one with SWAT.
Printing is still a pain, using floppies, instead of the network.
I had a so-called Cups Expert tell me I was an idiot in irc, because they couldn't work out what was going on.
Apparently (according to smbclient -L ) there are no samba shares on the non-printer box, but that doesn't stop me being able to browse my home directory from a windows box on the network!!
Any ideas anyone, I'm in IRC as irvken most of the time.
cowanrl
07-22-2003, 05:34 PM
In less you have a specific need to, you shouldn't need to create a separate share for each printer you want to share with Samba. Just use the special [printers] share and let Samba take care of it.
Also, when I share a printer out on my Linux box for use by Windows machines, I create a separate printer and use a queue type of raw. I then set the printer driver on the Windows machine. This way, the Linux machine doesn't do any thing with the print job but pass it on to the printer. It usually works without a hitch.
I'm using Red Hat 9 with cups printing. Using Samba, I share out a HP LJ2200 that's attached to an LPD type print server on the network. I used the GUI print manager that comes with Red Hat to create the printer.
Here's my smb.conf file:
[global]
workgroup = the_cowans
netbios name = delldim
server string = Dell Dimension 8200
printcap name = /etc/printcap
load printers = yes
printing = cups
log file = /var/log/samba/%m.log
max log size = 0
security = server
password server = *
encrypt passwords = yes
smb passwd file = /etc/samba/smbpasswd
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
local master = no
domain master = no
preferred master = no
wins server = 10.10.1.3
dns proxy = no
#============================ Share Definitions ==============================
[savefile]
path = /savefile
browseable = yes
writeable = yes
guest ok = no
[homes]
comment = Home Directories
browseable = no
writable = yes
valid users = %S
create mode = 0664
directory mode = 0775
# If you want users samba doesn't recognize to be mapped to a guest user
; map to guest = bad user
# NOTE: If you have a BSD-style print system there is no need to
# specifically define each individual printer
[printers]
comment = All Printers
path = /var/spool/samba
browseable = yes
# Set public = yes to allow user 'guest account' to print
guest ok = yes
writable = no
printable = yes
That one [printers] share takes care of sharing out my printer. I can attach to the printer from my Windows machines and just load the printer driver locally on them. It works OK.
I'm not really familiar with any cups configuration file so if there are any you would like to see, let me know.
anarcholinuxism
07-23-2003, 05:30 AM
I've tried to copy your printers section using Swat but every time I change browseable to yes, it reverts to No, any idea why that is happening.
I was told in another fora that if I had cups running the printer on the print server would automatically be available to other linux machines on the network with no extra setting up, but that doesn't seem to be the case either.
cowanrl
07-23-2003, 10:01 AM
Even though SWAT is an excellent tool, I don't use it for configuring Samba here. All I ever use it for is the help files that come with it. I really don't know why it won't accept the setting of browseable = yes for your printer.
However, that setting alone won't keep you from sharing out your printer with Samba. It just means the printer won't show up in browse lists when you try to connect to it. That can be a real inconvenience but it won't keep it from working. You just have to remember the name of the printer.
If you can't get it to accept browseable = yes, I suggest you edit your smb.conf file by hand. Any text editor will do. You can use vi or pico from the command line or gedit or something similar from the GUI. The only requirement is that you be root to edit it.
This install of Red Hat 9 is the first time I've ever used cups for printing so I'm not very familiar with it at all. All I know is that I like it.
But even with LPD printing, if you have a printer physically attached to your Linux machine, other Linux machines and Windows NT, Win2k and XP machines should be able to print to it without sharing it out with Samba. You would just need to provide them with the IP address and queue name of the printer. It would be no different than having a printer attached to a print server on the network. Win9x machines would not be able to print to it without adding software to them to enable LPD printing. It may be the same with cups. I'll have to try it.
The thing I like about using Samba to share it out is that it takes care of queuing all of the print jobs from all workstations. The workstations just send the job off to the server then go on about their business. I'm pretty sure that if you set each workstation to print to the Linux printer as an LPD printer, they would each queue their own print jobs locally.