Skip to content

Instantly share code, notes, and snippets.

@piranna
Created May 4, 2012 12:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save piranna/2594470 to your computer and use it in GitHub Desktop.
Save piranna/2594470 to your computer and use it in GitHub Desktop.
Script to open a remote X11 graphic session via ssh
#!/bin/sh
# Script to open a remote X11 graphic session via ssh
#
# (c) 2012 Jesús Leganés Combarro "piranna" <piranna@gmail.com>
# for Vaelsys (http://www.vaelsys.com)
#
# To use it, just set the parameters to you own needs. It requires that you have
# a SSH Public-Key Authentication to the remote machine properly configured.
# Binaries
XINIT=/usr/bin/xinit
SSH=/usr/bin/ssh
GNOME_SESSION=/usr/bin/gnome-session
# Parameters
USER=jesus
IP=192.168.0.14
DISPLAY=:1
VT=vt8
# Commands
CMD="$GNOME_SESSION"
SSH_CMD="$SSH -l $USER -C -X $IP $CMD"
$XINIT $SSH_CMD -- $DISPLAY $VT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment