If all your X2Go servers, X2Go clients and the available network printers are all on the same site (i.e. in the same office) and you neither intend to provide mobile or home office desktop environments, then you will not need X2Go printing.
Connect all your office printers directly to the network (IPP, LPD, AppJetDirect printing). Configure your central print server (mostly CUPS, Common Unix Printing System) to print directly to your networked office printers. Also make sure that your office printers are available to users that logon to your X2Go server(s).
Setting up CUPS and CUPS printers is not an explicit X2Go issue, please consult the CUPS howtos available on the internet.
For other scenarios, please use a central CUPS server (see multi-node printing below) without the X2Go printing feature installed.
Before you begin!
Please make sure that you are familiar with basic X2Go printing setups as described here. Only if you have successfully set up a single-node printing X2Go site go deeper and try out the multi-node setup.
If you would like to run your X2Go server and the CUPS service on different machines (such a scenario is very common if you run more than one X2Go server on your network), you'll have to do things:
x2goprint
) to accept print jobs from the central CUPS server (pushed there via SCP)
Please make sure that you are logged as a user on CUPS and X2Go server(s) that can become the super-user by running the sudo
command.
As first step: install the X2Go server printing add-on to your (every) X2Go server:
$ sudo aptitude install x2goserver-printing
Next, install the CUPS X2Go backend on the CUPS server:
$ sudo aptitude install cups-x2go
On the CUPS server create root
's SSH configuration directory:
$ mkdir -p /root/.ssh/
Now you can generate an SSH public/private key. This key is used to allow passwordless logons from root@cupsserver
to x2goprint@x2goserverX
.
$ ssh-keygen -N "" -t dsa -f /root/.ssh/id_dsa-x2goprint
The public part of the key (/root/.ssh/id_dsa-x2goprint.pub
) needs to be added to the x2goprint
user's authorized_keys
file on each of your X2Go servers. You can use the ssh-copy-id
command for that:
root@cupsserver:~$ ssh-copy-id /root.ssh/id_dsa-x2goprint x2goprint@x2goserver1.your.domain root@cupsserver:~$ ssh-copy-id /root.ssh/id_dsa-x2goprint x2goprint@x2goserver2.your.domain # etc.
Every X2Go server that uses X2Go printing needs to be known by the CUPS server. Regarding your name resolution type, you'll need to add the host names for example to the local /etc/hosts file (your even better: use your local DNS server!!!). Please test if you are able to build up SSH connections from your CUPS server to your X2Go servers by entering the following command.
root@cupsserver:~$ ssh -i /root/.ssh/id_dsa-x2goprint x2goprint@x2goserver1.your.domain root@cupsserver:~$ ssh -i /root/.ssh/id_dsa-x2goprint x2goprint@x2goserver2.your.domain # etc.
If this is your first login from root@x2goserverX.your.domain
to x2goprint@x2goserverX.your.domain
the SSH command will ask you to accept the host key of the X2Go server(s). Please accept the displayed host keys.
At last, you have to add the following line to your /etc/sudoers file. Normally the command visudo
is highly recommended for editing the sudoers file, as it performs sanity checks on the sudoers file and reports if you made a mistake while editing the file.
x2goprint ALL=(ALL) NOPASSWD: /usr/bin/x2goprint