Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have SSH access to a remote host (FreeBSD) that has a printer set up. I do not have root access on that host or any other special user rights. Now I want to print directly from my laptop on that printer (Ubuntu 10.10). The problem is that I don't know how to "import" or whatever the the printer, as it needs authetification from my user account (print quota limitations). E-mailing me the files I want to print or scp them every time is a pain, ATM I pipe the PostScript output manually to a ssh command, but that's also a huge working overhead. E.g. when I want to print a foo.pdf

pdftops '/path/to/foo.pdf' - | ssh user@remotehost 'lpr -P printername'

So, does anyone know of a smooth way to shorten this procedure? Ideally I would just want to use a printername instead of the whole ssh command

share|improve this question

Why is piping a huge overhead? Because of the typing?

Just put your command in a small script/function/alias and create a passwordless ssh key and add the public part to the remot ~/.ssh/authorized_keys and it will become probably much easier.

You could also use a ssh key with password and cache the password using

ssh-add ~/.ssh/your_private_key

So you have the security of a key with password but don't have to type it every time.

Another way would be to create ssh tunnels to the right ports. ssh -L ... would do it, read man ssh. You can also add this tunnels to your ~/.ssh/config using LocalForward so you create a connection with this port tunnels already defined.

share|improve this answer

I have not tried this particular script, but my solution would be something like this SSH-LPR Backend for CUPS:

The idea is to set up a local CUPS printer that uses this backend to handle the SSH transfer for you. It will involve setting up SSH public/private keys and a little messing with CUPS, but the result will be a "local" printer with the SSH handled seamlessly behind the scenes.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.