Printing over the Network using SSH
At my university (KIT) students can print documents on paper at the atis. There are multiple ways of printing files over the network, maybe some of the different methods outlined below may also help you in similar situations.
Some of the methods are going to be using ssh with the host atis
. For a similar setup you can add the following to your local ~/.ssh/config
(replace s_name
with your username):
Host atis
HostName i08fs1.informatik.kit.edu
User s_name
-
The “official” way is to use one of the so-called “pool-computers” (Fedora), which are pre-configuerd with CUPS to access all printers over the network. The obvious disadvantage is that you can’t use your own laptop and have to somehow transfer the files before printing them.
- The “terminal” way is to use lpr
foo@bar:~$ ssh atis lpr -P pool-sw1 < Downloads/script.pdf
This prints the file
script.pdf
(from theDownloads
directory offoo
) on printerpool-sw1
. - The “slow graphical” way is to print using X11-forwarding. This way is insecure and shouldn’t be used for a multitude of reasons.
foo@bar:~$ scp Downloads/script.pdf atis:Downloads/ script.pdf foo@bar:~$ ssh atis -X xdg-open Downloads/script.pdf
This first copies the file
script.pdf
(from theDownloads
directory offoo
) to the server using scp and then starts a programm on the server to open the file, but the graphics are shown on the client side. Hopefully it starts a programm you are familliar with that doesn’t lagg too much, because everthing needs to be send over the network. You might need to enable X11-forwarding by addingX11Forwarding yes
to/etc/ssh/sshd_config
. - The “fancy” way is to forward the CUPS port over to your machine, so you can execute everything on your local machine.
foo@bar:~$ ssh atis -L 10631:localhost:631
You can now open your printing settings
And set the CUPS-server tolocalhost:10631
Now you can open your pdf-viewer, click on print and do everything how you are used to do it.