LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 08-03-2011, 10:59 AM   #1
Uqbar
LQ Newbie
 
Registered: Aug 2007
Location: Regnum Utriusquĉ Siciliĉ
Distribution: (K)Ubuntu 11.04
Posts: 14

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 192.168.0.2:631:127.0.0.1:631 root@server

(192.168.0.2 is a dummy interface on the server)

This means that any connection on TCP port 192.168.0.2:631 in the server will be forwarded straight to TCP port 127.0.0.1:631 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:

ipp://192.168.0.2:631/printername
http://192.168.0.2:631/printername/
http://192.168.0.2:631/ipp/
http://192.168.0.2:631/ipp/printername
ipp://192.168.0.2/ipp/
ipp://192.168.0.2/ipp/printername

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
mpapet
Member
 
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
allend
Senior Member
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware-current
Posts: 3,431

Rep: Reputation: 848Reputation: 848Reputation: 848Reputation: 848Reputation: 848Reputation: 848Reputation: 848
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?
Code:
# Allow remote access
Listen *:631
On the local server in cupsd.conf you will need lines like
Code:
# Show remote shared printers
BrowseRemoteProtocols CUPS
BrowsePoll 192.168.0.2:631
to show the remote printer.
 
Old 08-05-2011, 05:34 AM   #4
Uqbar
LQ Newbie
 
Registered: Aug 2007
Location: Regnum Utriusquĉ Siciliĉ
Distribution: (K)Ubuntu 11.04
Posts: 14

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: http://www.cups.org/str.php?L3912
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).
 
  


Reply

Tags
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 11:04 PM.

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