Go Job Hunting at the LQ Job Marketplace
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 08-03-2011, 10:59 AM   #1
LQ Newbie
Registered: Aug 2007
Location: Regnum Utriusquĉ Siciliĉ
Distribution: Kubuntu 14.04
Posts: 21

Rep: Reputation: 0
Question CUPS to CUPS through SSH port forwarding

I have a remote machine running CUPS and managing a locally (USB) connected printer. Everything works fine as expected.

I have another machine also running CUPS for a number of printers that are either local or on the same LAN of the server. Also this works fine.
I need to be able to print from this server on the first remote machine's printer.
I managed to have a remote forwarding like this on the remote machine:

machine# ssh -C -N -T -R root@server

( is a dummy interface on the server)

This means that any connection on TCP port in the server will be forwarded straight to TCP port on the remote machine with the printer.

On server's CUPS web UI I've tried to add a printer (with the proper driver) like this:


The printer in the remote machine doesn't print anything.
The logs say:
Unable to get the printer status (Bad request)

How can I add the remote machine printer to the server's CUPS configuration?

Thanks in advance.
Old 08-04-2011, 04:41 AM   #2
Registered: Nov 2003
Location: Los Angeles
Distribution: debian
Posts: 453

Rep: Reputation: 46
Are port 631 TCP and UDP packets being forwarded correctly? Does the printer have TCP/UDP stuff that needs to be forwarded?

Wireshark can help you figure this out.

Last edited by mpapet; 08-04-2011 at 04:45 AM.
Old 08-04-2011, 10:06 AM   #3
Senior Member
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware-current
Posts: 3,875

Rep: Reputation: 1045Reputation: 1045Reputation: 1045Reputation: 1045Reputation: 1045Reputation: 1045Reputation: 1045Reputation: 1045
Is the printer on the remote machine configured for shared access? Check that "Shared Yes" appears in section for the printer in the output of 'cat /etc/cups/printers.conf', or use the web interface.

Does the remote machine allow remote access in cupsd.conf?
# Allow remote access
Listen *:631
On the local server in cupsd.conf you will need lines like
# Show remote shared printers
BrowseRemoteProtocols CUPS
to show the remote printer.
Old 08-05-2011, 05:34 AM   #4
LQ Newbie
Registered: Aug 2007
Location: Regnum Utriusquĉ Siciliĉ
Distribution: Kubuntu 14.04
Posts: 21

Original Poster
Rep: Reputation: 0
I've tried a number of options in the configuration files as well as tcpdump (the CLI equivalent for wireshark).
I finally found the way to refer to the IPP printer properly (RTFM as usual) and even traced the IPP packets to from source to destination. Everything was fine, but no print was coming out, as stated by the CUPS logs.
Then I've filed a bug to CUPS/Apple:
The response is quite disappointing: you won't ever do that.
Of course, by sharing the printer with SAMBA and forwarding that protocol (TCP:139) I have been able to do it.

Just for the sake of completeness, the point is simple.
IPP is actually http on port 631, so CUPS is a web server that uses the same TCP port for both print job submissions *and* CUPS configuration. The designers decided to protect just the port 631 and not just the CUPS configuration service (which uses a different URL than submission).


cups, ssh tunnel

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
CUPS ERROR: [Job ???] Request file type is text/plain. (CUPS on ARM architectu abhinit Linux - Software 3 04-22-2011 03:19 AM
[SOLVED] CUPS unable to print. CUPS runs gs and libgs8 shows segfault in /var/log/messages ianthe Linux - Software 6 07-16-2010 07:11 AM
CUPS, and CUPS-PDF error when restarting, or starting process Predatorian Linux - Desktop 0 10-28-2009 09:21 AM
CUPS and forwarding credentials question jacksmash Linux - Networking 3 03-21-2007 12:31 PM
remote cups printing to a smb/cups print server? justanothergeek Linux - Networking 2 09-15-2004 08:31 AM

All times are GMT -5. The time now is 08:37 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration