Friday, July 8, 2011

Printer Sharing on Ubuntu 10.10

Set the Linux Printer Server

The procedure below is tested on Linux Printer Server running Ubuntu 10.10 and CUPS 1.4.4. To setup the Linux Printer Server, make sure that the server can print into the connected printer. Once this is done, you can enable print sharing.

a) Click on System -> Administration -> Printing
b) Click on Add Printer and select your printer on the listed items
c) Afterwards, test if you can print from your server.

d) Enable print sharing by right-clicking on the printer and selecting "Properties" menu.
e) On the Policies, check the State "Enabled, Accepting jobs, and Shared"
f) Under access control select the button "Deny printing for everyone except these users:", then type in the list of users you want to share printer and click on the "Add" button. (e.g., bisita - this should be equivalent to the user logged in on the client machine)
g) Click on the button "Apply" then "OK"
h) On the "Printer Configuration" window, select the Server->Settings menu.
i) Check the item "Publish shared printers connected to this system", and "Allow printing from the Internet", then click on the OK button.
j) Restart the cups daemon by typing on the terminal:

# /etc/init.d/cups restart


On a Linux Client Machine

a) Click on System->Administration->Printing
b) Click on the Add button
c) Under the "Network Printer", select "Internet Printing Protocol"
d) Under the Host field, type in the IP address of the printer server (e.g., 192.168.1.10)
e) Under the Queue field, type in the name of the printer after the prefix /printers/ (e.g., /printers/hp900)
f) Click the button to "Verify" to confirm if your settings are good.
g) Then click the "Forward" button and select your printer on the listed items
h) Type in a description of your printer (e.g., hp900)
i) Finalized the setup by clicking the "Apply" and "OK" button

If everything goes smoothly, you should be able to print from your Linux client machine to your Linux Printer Server.


Windows Printing Thru CUPS


Windows can print to a Linux Print Server running cups. I assume that the CUPS server has been properly installed on a Linux server and it has been set as "sharing". The following procedure is how to set the printer under Windows (I have tested it under Windows XP Home Edition but my guess is it should work on most Windows variants):

a) Add Printer
b) Select "Connect Printer to the Internet"
c) Type in the address of CUPS server and the print queue (e.g., http://192.168.1.117:631/printers/hp900)
d) When prompted for the printer type, select "Generic", then select "MS Publisher Imagesetter" (This is usually a built in driver on Windows)

That's it.

Test your printing. You can monitor the status of your printing by going to your browser and typing the address (e.g., http://192.168.1.117:631) and clicking on the "Jobs" menu.

Erratum: The above procedure does not work with Windows 7 Starter Edition.



Printer Sharing via LPD

Print Sharing thru the legacy LPD is implemented via the cups-lpd daemon. This is activated through the xinetd superserver daemon. The procedure are as follows:

a) On the Linux Printer Server, download the xinetd superserver daemon xinetd by typing the command on the terminal:

# apt-get install xinetd

b) Configure the xinetd daemon by typing creating the a (e.g., printer ) under the directory /etc/xinetd.d/ and typing the following settings:

service printer
{
socket_type = stream
protocol = tcp
wait = no
user = bisita
group = sys
server = /usr/lib/cups/daemon/cups-lpd
server_args = -o document-format=application/octet/stream
}


c) Start the xinetd server by typing the command:

# /etc/init.d/xinetd start


d) Create the file hosts.lpd under the directory /etc and type in the name of allowed hosts (e.g., mydesktop ). Be sure the hostname mydesktop can be properly identified in the network. If not, include the name under the hosts file.




Printer Sharing under SMB protocol

The procedure below assumes that you have done the above procedure on Printer Sharing via LPD. The reason for this is that the Samba Server setup here for printing relies on the bsd as the printing mode.


a) Download and install the Samba software in the server.

# apt-get install samba


b) Configure the Samba server by editing the file /etc/samba/smb.conf given the pattern below:

[global]
workgroup = RASUL
netbios name = TIKBALANG
passdb backend = tdbsam

printcap name = cups
printing = bsd
load printers = yes


[printers]
comment = All Printers
browseable = yes
security = share
use client driver = yes
guest ok = yes
path = /var/spool/smbprint
printable = yes
public = yes
writable = yes
create mode = 0700


c) Create the directory /var/spool/smprint and change the ownership to 777 mode.

# mkdir /var/spool/smbprint
# chmod 777 /var/spool/smbprint


d) Restart the Samba server as follows:

#/etc/init.d/nmbd restart
#/etc/init.d/smbd restart


Afterwards, test if you can print from a Windows or Linux client machine.

Friday, July 1, 2011

Setting the Network Card to Static IP on Ubuntu

Edit the /etc/network/interaces file to:

auto eth1
iface eth1 inet static
address 10.10.10.2
netmask 255.255.255.0
gateway 10.10.10.1
dns-nameservers 10.10.10.250 10.10.10.251