Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

One-click connect from cygwin to full-screen Linux (X stuff required) (See related posts)

Optional: execute the following once (see http://hacks.oreilly.com/pub/h/66 for
details), to avoid typing in the password.

set LINUX_HOST=mylinuxhost
ssh-keygen -t rsa
ssh %USERNAME%@%LINUX_HOST% "mkdir .ssh; chmod 0700 .ssh"
bash -c 'scp ~/.ssh/id_rsa.pub %LINUX_HOST%:.ssh/authorized_keys2'


Now, if you save the following as a BATCH file, you can just click it
to connect to fullscreen Linux:

set LINUX_HOST=mylinuxhost
start /min xinit 
xhost +%LINUX_HOST%
ssh %LINUX_HOST% "declare -x DISPLAY=%COMPUTERNAME%:0; echo $DISPLAY;gnome-session"'


NOTES:
1.
Sometimes xhost + does not execute in time. O well. Just close
all windows that got opened and try again.

2.
If you didn't do the step one (ssh keys), you will be prompted
to enter the linux password; this increases the chances of the above
error.

3.
The single terminal window appearing in the Linux desktop is in fact
a window from your PC.


Comments on this post

nilspace posts on Jan 26, 2006 at 18:34
I use the XWin query to get an actual remote host login screen.

XWin.exe -query hostname

Make a shortcut and set this as the target (may need path to XWin.exe). Double-click to login, fullscreen, to remote machine.
debedb posts on Jan 27, 2006 at 16:34
But this doesn't send any windows from remote machine. What account would it log
in to?

You need to create an account or log in to post comments to this site.


Click here to browse all 5147 code snippets

Related Posts