.\" xqproxy - XDMCP Query Proxy .\" Copyright (C) 2009 - Vic Lee .\" .\" This program is free software; you can redistribute it and/or modify .\" it under the terms of the GNU General Public License as published by .\" the Free Software Foundation; either version 2 of the License, or .\" (at your option) any later version. .\" .\" This program is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public License .\" along with this program; if not, write to the Free Software .\" Foundation, Inc., 59 Temple Place, Suite 330, .\" Boston, MA 02111-1307, USA. .\" .de EX \"Begin example .ne 5 .if n .sp 1 .if t .sp .5 .nf .in +.5i .. .de EE .fi .in -.5i .if n .sp 1 .if t .sp .5 .. .TH XQPROXY 1 "xqproxy 0.1.0" "X Version 11" .SH NAME xqproxy \- XDMCP Query Proxy .SH SYNOPSIS .B xqproxy [-display n] [-host hostname] [-port port] [-timeout seconds] [-query [-xauth]] [-manage [-sessionid session-id]] .SH DESCRIPTION .I xqproxy is a proxy program that can send XDMCP query to a display manager to establish XDM session for an existing local X display. .SH OPTIONS .PP .TP 8 .B \-display n The local display number. Default is 0. .PP .TP 8 .B \-host hostname The hostname of the remote display manager. Default is localhost. .PP .TP 8 .B \-port port The XDMCP UDP port of the remote display manager. Default is 177. .PP .TP 8 .B \-timeout seconds Timeout value while waiting for response from the server. .PP .TP 8 .B \-query Sends QUERY and REQUEST to the display manager to request a new session. The session id and magic cookie will be printed in stdout. .PP .TP 8 .B \-xauth When use together with -query option, xqproxy will call xauth to add the magic cookie to local .Xauthority database. .PP .TP 8 .B \-manage Sends MANAGE to the display manager to start the session. If this option is used together with -query, it will always use the session id returned from the display manager. Otherwise, it will uses the session id assigned by -sessionid argument. .PP .TP 8 .B \-sessionid session-id The new session id returned from the display manager. This option is useful only if -manage option is used separately. .SH EXAMPLES .PP The following command request the display manager on REMOTEHOST to establish an XDM session directly to a local X server on display :1 : .PP xqproxy -display 1 -host \fIREMOTEHOST\fP -query -xauth -manage .PP The following shell script request the display manager supplied by the first argument to establish an XDM session over a secure SSH tunnel on a local display supplied by the second argument (note that xqproxy runs on the server) : .PP #!/bin/sh .br # Usage: xqssh .br SSH=$(which ssh) .br if [ "x$SSH" = "x" ]; then .br echo openssh is required in order to use xqssh. .br exit 1 .br fi .br QUERY=$(ssh $1 xqproxy -display $2 -query) .br echo "$QUERY" .br SESSIONID=$(echo "$QUERY" | awk '/ACCEPT/ {print substr($3,12)}') .br COOKIE=$(echo "$QUERY" | awk '/ACCEPT/ {print substr($7,12,32)}') .br if [ "x$SESSIONID" = "x" ] || [ "x$COOKIE" = "x" ]; then .br exit 1 .br fi .br xauth add :$2 MIT-MAGIC-COOKIE-1 $COOKIE .br PORT=$(expr 6000 + $2) .br ssh -R $PORT:localhost:$PORT -fN $1 .br ssh $1 xqproxy -display $2 -manage -sessionid $SESSIONID .br exit 0 .PP .SH "SEE ALSO" ssh(1) .SH BUGS .PP Please send bugs to Vic Lee .SH AUTHORS Vic Lee