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.
Posted in Software & Programming
by markus
November 9th, 2007 at 10:09 am
Du, mach amal wieder a gscheids abdedd!
July 21st, 2008 at 6:18 am
Wow,
That’s really amazing.
interesting to know.
August 24th, 2009 at 3:43 pm
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
August 24th, 2009 at 3:47 pm
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 :-/