Sharing my printer via Samba

Connection sharing, Firewall, Samba..etc
Forum rules
Before you post please read how to get help
Post Reply
leo_mancini
Level 1
Level 1
Posts: 45
Joined: Thu Jul 14, 2011 8:23 am

Sharing my printer via Samba

Post by leo_mancini » Sun Jul 17, 2011 5:22 am

Hi all,

Background
I have recently set up a share between my Linux Mint (version 11) and my Windows 7 computers (as mentioned in a recent previous post).
Since installing Linux Mint, today was the first time that I used my printer (Samsung ML-2010). As soon as I connected the printer Linux Mint detected
it and allowed me to use the printer within Linux.

Issue
Despite successfully setting up my printer in Linux, I am unable to see the printer from my Windows 7 computer.
From within the 'Samba' application it displays under the following headings

Directory Share Name Permissions Visibility Descriptions
/var/lib/samba/printers print$ Read Only Visible Printer Drivers

I assumed that this would automatically allow the detection of my printer by default (from within Windows 7) but it has not.

Questions
How can I set up my printer from within Linux to be accessible from my Windows 7 pc?

Thank you.

altair4
Level 19
Level 19
Posts: 9689
Joined: Tue Feb 03, 2009 10:27 am

Re: Sharing my printer via Samba

Post by altair4 » Sun Jul 17, 2011 7:58 am

Step 1: Enable Sharing for that Printer.
Menu > Administration > Printing > Right Click the attached printer > Properties > Policies
Check Enabled, Accepting Jobs, and Shared

Step 2: Enable Publishing of the Shared Printer
Menu > Administration > Printing > Server > Settings > Check "Publish Shared Printers connected to this system"

Step 3: Allow guest access to printer

Edit smb.conf as root:

Code: Select all

gksu gedit /etc/samba/smb.conf
Change the "guest ok" line from no to yes in the [printers] special share:
[printers]
comment = All Printers
browseable = No
path = /var/spool/samba
printable = yes
guest ok = yes
read only = yes
create mask = 0700
Step 4: Restart these services in this exact order:

Code: Select all

sudo service cups restart
sudo service smbd restart
Wait a few minutes for the network to settle down and see if you can connect to the printer.

Note: It's the [printers] share that allows remote clients to access samba printers. It's not like a normal samba share as it does not specify an exact printer but rather it reads the list of "published" printers from CUPS and makes those available to the network which is why "cups" needs to run before "smbd".
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.

leo_mancini
Level 1
Level 1
Posts: 45
Joined: Thu Jul 14, 2011 8:23 am

Re: Sharing my printer via Samba SOLVED

Post by leo_mancini » Sun Jul 24, 2011 8:22 am

Hi There,

Despite following your advice. This did not work.

What I did to make the printer work was adjust the lines in the /etc/samba/smb.conf file as below and made sure that Gest ok = yes
Then restarted the cups and samba service using the
sudo service cups restart
sudo service smbd restart

commands.

# Windows clients look for this share name as a source of downloadable
# printer drivers
[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
; browseable = yes
; read only = yes
; guest ok = yes

Thank you.

altair4
Level 19
Level 19
Posts: 9689
Joined: Tue Feb 03, 2009 10:27 am

Re: Sharing my printer via Samba

Post by altair4 » Sun Jul 24, 2011 9:11 am

That's interesting for a couple of reasons the biggest of which is this line:
; guest ok = yes
Because of the ";" in front of the line. It is telling Samba to ignore the line - it's "commented out".

But if it works it works, right ?
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.

Post Reply

Return to “Other networking topics”