Sharing Printers in Ubuntu

After you have added your printer, you can share it with other people on the network. Sharing the printer requires knowing who will use it: other system using CUPS, other devices using LPD, or other computers running Windows.


Sharing With CUPS
To share the printer with CUPS, you will need to configure both the printer server and the client.

On the print server:
1. Edit /etc/cups/cups.d/ports.conf and change the line that reads Listen localhost:631 to Port 631. This tells CUPS to allow printing from any remote system.

2. (Optional) Edit /etc/cups/cups.d/browse.conf and change Browsing off to Browsing on. This allows the server to announce the printer's availability to other hosts on the network. The default is an announcement every 30 seconds.

3. Restart the CUPS subsystem on the print server.
sudo /etc/init.d/cupsys restart

On the print client:
1. Go to System -> Administration -> Printing to open the printer applet.

2. Double-click New Printer to configure the device.

3. Select a Network Printer and the CUPS Printer (IPP) protocol.

4. Enter the printer host name and printer name as a URL. For example, if the server is named printer.example.com and the printer is called Okidata127, then you would use ipp://printer.example.com/printers/Okidata127.

5. Click the Forward button and select the printer model.

6. Create a description for the printer

7. Click on the Apply button to create the printer.

CUPS provides many configuration options, but it has a long history of being a security risk. The CUPS installation includes a web-based administration interface. By default, it is not accessible remotely. (But if you followed the steps under Sharing With CUPS, then it is remotely accessible.) The URL for this interface is http://localhost:631/.

Although you can use the CUPS web interface to view and manage the print queue, the default administration interface does not permit adding new printers or changing configurations. This functionality is disabled in Ubuntu primarily due to security risks. Enabling this interface is not recommended. Instead, if you need to modify printer configurations, use the System -> Preferences -> Printing applet.


Sharing With LPD
Enabling LPD support is a little more complex since Ubuntu does not normally include servers.

On the print server:
1. Install xinetd on the print server. This is the extended Internet daemon for running processes.
sudo apt-get install xinetd

2. Create a configuration file for the printer service. This requires creating a file called /etc/xinetd.d/printer. The contents should look like this:
service printer
{
socket_type = stream
protocol = tcp
wait = no
user = lp
group = sys
server = /usr/lib/cups/daemon/cups-lpd
server_args = -o document-format=application/octet/stream
}

3. Restart the xinetd server.
sudo /etc/init.d/xinetd restart

On the printer client:
1. Go to System -> Administration -> Printing to open the printer applet.

2. Double-click New Printer to configure the device.

3. Select a Network Printer and the Unix Printer (lpd) protocol.

4. Enter the print server host name (or IP address) in the Host field and the CUPS printer name under the Queue field.

5. Continue through the remaining screens to select the printer type and configuration. On the final screen, click the Apply button to create the printer.


Sharing with Windows
It is usually best to use a native printing protocol. For Ubuntu, LPD and CUPS are native. Most versions of Windows support network printing to LPD servers, so sharing with LPD should be enough, but it requires user to configure their printers.

Native Windows environments can share printers using the Server Message Block (SMB) protocol. This allows Windows users to browse the Network Neighborhood and add any shared printers-very little manual configuration is required. For Ubuntu to share a printer with Windows users requires installing SAMBA, an open source SMB server.

On the print server:
1. Install SAMBA on the print server. This provides Windows SMB support.
sudo apt-get install samba

2. Create a directory for the print spool.
sudo mkdir /var/spool/smbprint

3. Edit the SAMBA configuration file: /etc/samba/smb.conf.

4. Change workgroup = to match your Windows Workgroup.

5. Under the [global] section is an area for printer configuration. Uncomment (remove the leading ;) the load printers = yes and CUPS printing lines.

6. Set the [printers] section to look like this:
[printers]
comment = All Printers
browseable = no
security = share
use client driver = yes
guest ok = yes
path = /var/spool/smbprint
printable = yes
public = yes
writable = yes
create mode = 0700
This setting allows any Windows client to access the printers without a password.

7. (Optional) Under the [printers] section, set browseable = yes. This allows Windows systems to see the printers through the Network Neighborhood.

8. Restart the SAMBA server.
sudo /etc/init.d/samba restart

On the Windows client, you can add the printer as if it were a Windows printer. For example, if the server's name is printer.example.com and the printer is Okidata127, then the shared printer resource would be \\printer.example.com\Okidata127. Windows clients will need to install their own print drivers.

>>> Read more about Adding Printers in Ubuntu <<<

Source of Information : Hacking Ubuntu Serious Hacks Mods and Customizations

No comments:

Cloud storage is for blocks too, not just files

One of the misconceptions about cloud storage is that it is only useful for storing files. This assumption comes from the popularity of file...