Remote printing via SSH

Thursday, July 5th, 2007 at 5:21 pm

Ever thought it would be a good idea to print via SSH maybe because you cannot connect to your favorite printing machine in any other way ?

It is straight forward to do; you establish a ssh tunnel to your machine, e.g. via a ssh gate into your company or institute:

ssh -L2222:internal.machine.name:22 -l userName gateAddress

Now you can simply run any command on the remote side and hence can trigger a printing job:

cat document.pdf | ssh -p 2222 localhost "acroread -toPostScript | lpr -PprinterName"

DONE :)

PS: acroread works much more reliable than pdf2ps, I don’t now why. psf2ps screws up with some documents.

by markus

4 Responses to “Remote printing via SSH”

  1. MaRie Says:

    Du, mach amal wieder a gscheids abdedd!

  2. Hotel Says:

    Wow,

    That’s really amazing.
    interesting to know.

  3. Henning Says:

    Hey Markus,

    Howdy? Just remembering this blogpost while trying to print on our institute’s printers from home – since I’m on “Elternzeit” :)

    This might be a more convinient solution?
    http://www.masella.name/technical/sshlpr.html

    Regards – Henning

  4. Henning Says:

    Hey Markus,
    Howdy? Long long time since we heard from each other…

    Just remembered this blogpost while trying to print to our Institute’s printers (since Im at home on “Elternzeit”, I’m not within my office)
    I also found http://www.masella.name/technical/sshlpr.html, which might be a simular and more convinient solution!?

    Best regards – Henning

    PS: Just submitted this a few seconds ago without cookies enabled … bad php(?) Errormessages :-/

Leave a Reply

Bot-Check