Sunday, February 15, 2015

Remote access to Debian Printing (CUPS) web interface from LOCAL

The Common UNIX Printing System (or CUPS) is a printing system and general replacement for lpd and other older systems. The CUPS Debian packages forms a nice, powerful and relatively easy to use printing system on Debian. (http://www.cups.org/)

Install Software:

aptitude update
aptitude install cups cups-client

Start the software:

/etc/init.d/cups start

The easiest way is to use the cups web interface. You can see it by going to

http://localhost:631/admin

But to get to this page remotely for a server, you need to first make some edits to the cupsd.conf file. So do the following:

1. Edit the cups configuration file by first running the following command on your server:

sudo nano /etc/cups/cupsd.conf

2. Change this section :

# Only listen for connections from the local machine.
#Listen localhost:631
Port 631
Listen /var/run/cups/cups.sock

3. Then change this sections :

< Location / >
# Restrict access to the server...
Order allow,deny
Allow from@LOCAL
< /Location >
< Location /admin >
# Restrict access to the admin pages...
Order allow,deny
Allow from@LOCAL
< /Location >
< Location /admin/conf >
AuthType Default
Require user @SYSTEM
# Restrict access to the configuration files...
Order allow,deny
Allow from@LOCAL
< /Location >

4. Finally, restart cups with the following:

sudo /etc/init.d/cups restart

5. You should now be able to log into cups on your server with:

http://your_server_ip_address:631


Note that when you change something, it may tell you that you need to add a certificate to firefox. Do so by clicking the add/get certificate button at the bottom of the firefox error message page. It will also tell you that to change stuff, you need to use the "https" version of the page instead of "http" so just go to:

https://your_server_ip_address:631

You might also have to open/port forward tcp port 631.

No comments: