0

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

guest
  • 1
  • 1

2 Answers2

1

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.

rems
  • 2,240
  • 13
  • 11
0

I have not tried this particular script, but my solution would be something like this SSH-LPR Backend for CUPS: http://www.masella.name/technical/sshlpr.html

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.

geekmonkey
  • 11
  • 1