Menu Close

How to setup a shared printer using Samba in Ubuntu 9.04

Here’s how to setup a shared printer using Samba in Ubuntu 9.04 Jaunty Jackalope. This is the easiest way to do it, since with guest access and no authentication, anyone who can access the computer over a network connection will be able to print to the shared printer.

However, this involves minimal security, so I would not recommend using this configuration on a machine with any actual file shares. Overall, I think this setup would be best for home users, or small offices. Enterprise users, or personal users with more rigorous security needs, should use a more secure configuration.

First, you will need a printer of some sort connected to your Ubuntu machine. Either a USB printer or a networked printer (one with its own IP address) will work, so long as it’s properly set up on your Ubuntu computer.

Open a Terminal window (Applications->Accessories->Terminal) and install Samba using the following command:

sudo apt-get install samba

We’ll need to edit Samba’s configuration file, smb.conf, with the following command (make certain to create a backup copy of the smb.conf file first, in case anything goes wrong):

sudo gedit /etc/samba/smb.conf

Once inside the smb.conf file, you’ll need to change a number of lines. Some of the lines will be commented out with a semicolon (;) or a crosshatch (#) in front of them. Note that any lines we change here will need to have the ; or the # removed to activate them.

Because we’re going to enable guest access in Samba (which is inherently less secure than user-based authentication), we’ll configure Samba by setting it so that only the local area network can access it:

interfaces = lo eth0
bind interfaces only = true

Edit these lines to enable guest access in Samba:

security = share

Finally, change the [printers] share definition so that it looks like this:

comment = All Printers
browseable = no
path = /var/spool/samba
printable = yes
guest ok = yes
read only = yes
create mask = 0700

Save your changes to the smb.conf file, and restart Samba with the following command:

sudo /etc/init.d/samba restart

You can test your Samba definitions with the use of the testparm command.

To use your shared printer, access your Ubuntu box from another machine. On a Windows PC, go to Start, Run, and type \\hostname (or the IP address, \\, and click OK. If you typed everything correctly, you should see a window with your printer icon. Double-click the printer icon to install it (make sure you have the correct driver for your model of printer on hand; check your manufacturer’s website) and you should be set to print.

How to share Folders HERE

0 0 votes
Article Rating
Notify of

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Inline Feedbacks
View all comments