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:
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.
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.
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?
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).
|All times are GMT -5. The time now is 02:32 AM.|