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
4 Comments