User Tools

Site Tools


wiki:advanced:multi-node:x2goserver-printing

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
wiki:advanced:multi-node:x2goserver-printing [2011/06/07 23:19]
sunweaver
wiki:advanced:multi-node:x2goserver-printing [2016/09/23 09:41] (current)
ionic Typo and headling capitalization fixes.
Line 1: Line 1:
-====== Printing and X2go ======+====== Printing Revisited ======
  
-If all your X2go servers, X2go clients and the available network printers are all on the same site (i.e. in the same office), then you will not need X2go printing. Configure your print server (mostly CUPS, Common Unix Printing System) to print directly to your office printers. Also make sure that your office printers are available to user's that logon to your X2go server (setting up CUPS printers is not an issue of X2go, please consult the CUPS howtos available on the internet).+===== Sites Where X2Go Printing Does Not Make Sense =====
  
-===== Installing X2go Printing =====+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. 
  
-:!: **Before you begin!** +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 printersAlso make sure that your office printers are available to users that logon to your X2Go server(s)
-> Please make sure that you have added the X2go repository to your package management systemThe required steps are described here: [[adding the x2go repository (Debian)|Debian]][[adding the x2go repository (Ubuntu)|Ubuntu]] (depending on the distro that you have chosen for your X2go server).+ 
 +Setting up CUPS and CUPS printers is not an explicit X2Go issueplease consult the CUPS howtos available on the internet. 
 + 
 +===== Using X2Go Printing on a Centralized CUPS Server =====
  
 <note> <note>
-X2go Printing is intended for  +X2Go Printing is intended for  
-   * use on low bandwith networks – like internet connections or GSM connections +   * use on low bandwidth networks – like internet connections or GSM connections 
-   * use of printers that are directly connected to X2go (thin-)clients+   * use of printers that are directly connected to X2Go (thin-)clients 
 +For other scenarios, please use a central CUPS server (see multi-node printing below) without the X2Go printing feature installed.
 </note> </note>
  
-X2go Printing (i.e. the ''x2goprint'' command) has become standard component of the ''x2goserver'' package (since May 2011).+:!: **Before you begin!** 
 +> Please make sure that you are familiar with basic X2Go printing setups as described [[doc:installation:printing|here]]Only if you have successfully set up single-node printing X2Go site go deeper and try out the multi-node setup.
  
-For being able to use X2go printing, you'll need a running CUPS server. You can use your network's existing CUPS server or you can install a CUPS server on the same machine as the X2go server tools are running on+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:
  
-By installing the X2go CUPS engine (package: ''cups-x2go'') you add »Virtual X2go Printer« backend to your CUPS server:+  - if running more than one X2Go server: setup up X2Go servers with [[wiki:advanced:multi-node:x2goserver-pgsql|PostgreSQL as X2Go session database backend]] 
 +  - generate a pair of SSH keys on the CUPS server to facilitate communication between CUPS server and X2Go server(s) 
 +  - add a line to the /etc/sudoers file on every X2Go server that enables the X2Go Server (script: ''x2goprint''to accept print jobs from the central CUPS server (pushed there via SCP) 
 + 
 +Please make sure that you are logged as 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:
  
 <code> <code>
-$ aptitude install cups-x2go+sudo aptitude install x2goserver-printing
 </code> </code>
- +   
-After the installation, you are able to add a new printer in CUPS, possibly named: »x2goprinter« (name is arbitrary). As printing device (i.e. backend) you should select the “Virtual X2go Printer” (vendor: »generic«, model: »Generic CUPS-X2GO Printer«). +Next, install the CUPS X2Go backend on the CUPS server:
- +
-You may configure further options by editing the file “/etc/cups/cups-x2go.conf” (the below code block shows the default set of options):+
  
 <code> <code>
-## +$ sudo aptitude install cups-x2go
-##  cups-x2go.conf -- CUPS Backend Configuration +
-## +
- +
-## Server with x2go system +
-#x2goserver = local +
- +
-## dsa key for user x2goprint +
-#printdsa = /root/.x2go/ssh/.x2goprint/id_dsa +
- +
-## command to generate pdf files +
-#ps2pdf = /usr/bin/gs -q -dCompatibilityLevel=1.4 -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pdfwrite -sOutputFile="%s.pdf" -dAutoRotatePages=/PageByPage -dAutoFilterColorImages=false -dColorImageFilter=/FlateEncode -dPDFSETTINGS=/prepress -c .setpdfwrite -f "%s"+
 </code> </code>
- +   
- +On the CUPS server create ''root'''s SSH configuration directory
-FIXME! The ''x2goprint'' command (unfortuntely still) expects an entry in ''/etc/sudoers''. You have to add the follwing line to your sudo system by issuing the ''visudo'' command (as root). Add this line to your sudo configuration: +  
 <code> <code>
-x2goprint ALL=(ALL) NOPASSWD: /usr/bin/x2goprint+$ mkdir -p /root/.ssh/
 </code> </code>
  
-===== Using X2go Printing on a Centralized CUPS Server ===== +Now you can generate an SSH public/private keyThis key is used to allow passwordless logons from ''root@cupsserver'' to ''x2goprint@x2goserverX''.
- +
-If you would like to run your X2go server and the CUPS service on different machines, you'll need to generate a pair of SSH keys to faciliate communication between those two machinesSuch a use case is very common if you run more than one X2go servers on your network. +
- +
-Please make sure that you are logged in as user ''root'' on the system running the CUPS service and add the following folders:+
  
 <code> <code>
-mkdir -/root/.x2go/ssh/.x2goprint/+ssh-keygen -N "" -t dsa -/root/.ssh/id_dsa-x2goprint
 </code> </code>
  
-Now you can generate the keys (on each X2go server that shall have access to the CUPS service):+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:
  
 <code> <code>
-$ ssh-keygen -N "" -t dsa -f /root/.x2go/ssh/.x2goprint/id_dsa+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.
 </code> </code>
  
-The public part of the key (''/root/.x2go/ssh/.x2goprint/id_dsa.pub'') needs to be added to the ''x2goprint'' user's ''authorized_keys'' file on each of your X2go servers. You can do this with your favourite editor. Please make sure, that you've chosen the right user and system:+Every X2Go server that uses X2Go printing needs to be known by the CUPS serverRegarding 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.
  
 <code> <code>
-x2goprint@x2goserver1:~$ cat id_dsa.pub >> ~/.ssh/authorized_keys +root@cupsserver:~$ ssh -i  /root/.ssh/id_dsa-x2goprint x2goprint@x2goserver1.your.domain 
-x2goprint@x2goserver2:~$ cat id_dsa.pub >> ~/.ssh/authorized_keys +root@cupsserver:~$ ssh -i  /root/.ssh/id_dsa-x2goprint x2goprint@x2goserver2.your.domain 
-etc.+etc.
 </code> </code>
  
-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 reach the X2go servers by entering the following command:+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.
  
 <code> <code>
-$ ssh -i  /root/.x2go/ssh/.x2goprint/id_dsa x2goprint@x2goserver1 +x2goprint ALL=(ALL) NOPASSWD: /usr/bin/x2goprint
-$ ssh -i  /root/.x2go/ssh/.x2goprint/id_dsa x2goprint@x2goserver2 +
-etc.+
 </code> </code>
  
wiki/advanced/multi-node/x2goserver-printing.1307488797.txt.gz · Last modified: 2013/03/08 13:31 (external edit)