Commit a84a02df authored by Russ Fish's avatar Russ Fish

Add Windows ssh-mime and rdp-mime connection handler scripts and install docs.

parent 32731856
......@@ -38,8 +38,12 @@ FILES += $(wildcard $(SRCDIR)/*.php3)
FILES += $(wildcard $(SRCDIR)/*.php)
FILES += $(wildcard $(SRCDIR)/*.ico)
FILES += $(wildcard $(SRCDIR)/*.class)
FILES += $(SRCDIR)/.htaccess $(SRCDIR)/error.shtml $(SRCDIR)/ssh-mime.pl \
$(SRCDIR)/ssh-mime-windows.pl $(SRCDIR)/rdp-mime.pl
FILES += $(SRCDIR)/.htaccess $(SRCDIR)/error.shtml \
$(SRCDIR)/ssh-mime.pl $(SRCDIR)/rdp-mime.pl \
$(SRCDIR)/ssh-mime-winxp.pl $(SRCDIR)/rdp-mime-winxp.pl \
$(SRCDIR)/ssh-mime-winxp.c $(SRCDIR)/rdp-mime-winxp.c \
$(SRCDIR)/ssh-mime-winxp.exe $(SRCDIR)/rdp-mime-winxp.exe \
$(SRCDIR)/emulab-mime-winxp.zip $(SRCDIR)/emulab-mime-winxp.reg
AUTOICONS = $(wildcard $(SRCDIR)/autostatus-icons/*.gif)
AUTOICONS += $(wildcard $(SRCDIR)/autostatus-icons/*.png)
......
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.tbssh]
@="tbssh_auto_file"
[HKEY_CLASSES_ROOT\tbssh_auto_file]
@="Emulab ssh connector"
[HKEY_CLASSES_ROOT\tbssh_auto_file\shell]
[HKEY_CLASSES_ROOT\tbssh_auto_file\shell\open]
[HKEY_CLASSES_ROOT\tbssh_auto_file\shell\open\command]
@="\"C:\\cygwin\\bin\\ssh-mime-winxp.exe\" \"%1\""
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.tbssh]
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.tbssh\OpenWithList]
"a"="iexplore.exe"
"MRUList"="ba"
"b"="ssh-mime-winxp.exe"
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.tbssh\OpenWithProgids]
"tbssh_auto_file"=hex(0):
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.tbssh]
@="tbssh_auto_file"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\tbssh_auto_file]
@="Emulab ssh connector"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\tbssh_auto_file\shell]
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\tbssh_auto_file\shell\open]
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\tbssh_auto_file\shell\open\command]
@="\"C:\\cygwin\\bin\\ssh-mime-winxp.exe\" \"%1\""
[HKEY_CLASSES_ROOT\.tbrdp]
@="tbrdp_auto_file"
[HKEY_CLASSES_ROOT\tbrdp_auto_file]
@="Emulab RDP connector"
[HKEY_CLASSES_ROOT\tbrdp_auto_file\shell]
[HKEY_CLASSES_ROOT\tbrdp_auto_file\shell\open]
[HKEY_CLASSES_ROOT\tbrdp_auto_file\shell\open\command]
@="\"C:\\cygwin\\bin\\rdp-mime-winxp.exe\" \"%1\""
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.tbrdp]
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.tbrdp\OpenWithList]
"a"="iexplore.exe"
"MRUList"="ba"
"b"="rdp-mime-winxp.exe"
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.tbrdp\OpenWithProgids]
"tbrdp_auto_file"=hex(0):
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.tbrdp]
@="tbrdp_auto_file"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\tbrdp_auto_file]
@="Emulab RDP connector"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\tbrdp_auto_file\shell]
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\tbrdp_auto_file\shell\open]
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\tbrdp_auto_file\shell\open\command]
@="\"C:\\cygwin\\bin\\rdp-mime-winxp.exe\" \"%1\""
/* rdp-mime-winxp.exe - Exe wrapper for a Perl script, making
* it acceptable as a file-type opener.
*
* Compile with gcc -o rdp-mime-winxp.{exe,c}
*
* EMULAB-COPYRIGHT
* Copyright (c) 2000-2003 University of Utah and the Flux Group.
* All rights reserved.
*/
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char **argv)
{
if (argc != 2)
printf("Usage: rdp-mime-winxp.exe pcxxx.tbrdp\n");
else
{
/* Just pass the file argument on to the Perl script. */
argv[0] = "rdp-mime-winxp.pl";
execvp(argv[0], argv); /* Shouldn't return. */
perror("rdp-mime-winxp.pl");
}
sleep(5);
return 1;
}
#!/usr/bin/perl -w
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2003 University of Utah and the Flux Group.
# All rights reserved.
#
use English;
use Getopt::Std;
#
# This is a helper program for your web browser. It allows you to rdp
# to an experimental node by clicking on a menu option in the shownode
# page. Its extremely helpful with jailed nodes, where rdpd is either
# running on another port, or on a private IP. Please see the Emulab FAQ
# for instructions on how to install this helper program.
#
# Obviously, it helps to have an ssh agent running.
#
sub usage()
{
print(STDERR "rdp-mime-winxp.pl <control-file>\n");
}
my $optlist = "";
my $config;
# Locals
my $hostname;
my $gateway;
my $port = "";
my $login = "";
#
# Turn off line buffering on output
#
$| = 1;
#
# Parse command arguments. Once we return from getopts, all that should be
# left are the required arguments.
#
%options = ();
if (! getopts($optlist, \%options)) {
usage();
}
if (@ARGV != 1) {
usage();
}
$config = $ARGV[0];
#
# Open up the config file. It tells us what to do.
#
open(CONFIG, "< $config")
or die("Could not open config file $config: $!\n");
while (<CONFIG>) {
chomp();
SWITCH1: {
/^hostname:\s*([-\w\.]+)$/ && do {
$hostname = $1;
last SWITCH1;
};
}
}
close(CONFIG);
#
# Must have a hostip. Port is optional.
#
if (!defined($hostname)) {
printf("Config file must specify a hostname\n");
sleep(5);
die("");
}
exec "mstsc /v:$hostname";
......@@ -26,11 +26,19 @@ remote Windows Desktop using the Remote Desktop Protocol (RDP). </p>
</ul>
<p>Clicking "RDP to Node" in the Node Options page will send your
browser a "text/x-testbed-rdp" ".tbrdp" file. In FreeBSD or Linux, you
can save the file and pass it as an argument to
<code>rdp-mime.pl</code> or associate it with <code>rdp-mime.pl</code>
in your web browser. You can download the <code>rdp-mime.pl </code><a
href="rdp-mime.pl">Perl program here</a>. </p>
browser a "text/x-testbed-rdp" ".tbrdp" file. <ul>
<li> In FreeBSD or Linux, you
can save the file and pass it as an argument to
<code>rdp-mime.pl</code> or associate it with <code>rdp-mime.pl</code>
in your web browser. You can download the <code>rdp-mime.pl </code><a
href="rdp-mime.pl">Perl program here</a>.</li>
<li> In Windows XP or 2000, you have the same choice to save and open the
.tbrdp file with a script, or associate it with the script in the browser
so you can just click. See the installation directions <a
href="#windows_install">below</a>.</li>
</ul>
</p>
<p>You can specify any display resolution (rdesktop window size) you
want in the rdp-mime.pl script. The default is 1280x1024 but it
......@@ -116,11 +124,70 @@ push your windows around to fit in the smaller space. </p>
</li>
</ul>
<font size='+1'><b>Instructions for Windows:</b></font>
<font size='+1'><b><a name="windows_install"></a>Instructions for Windows:</b></font>
<ul>
<li>Sorry, no windows support yet, although the script is really
simple, and should be trivially convertable to a windows batch
file, or even a windows Perl script if you care to install Perl on
your windows machine.
<li>For Windows XP or 2000, you can download the Emulab Perl programs and wrapper
programs in a <a href="emulab-mime-winxp.zip">zip file here</a>.
It contains {ssh,rdp}-mime-winxp.{c,exe,pl} .
The C programs are tiny wrappers which just exec the perl scripts.</li>
<li><font size='+1'><b>Software dependencies:</b></font></li>
<ul>
<li>The rdp-mime-winxp.pl script uses PuTTY to connect to the Emulab node.
<a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/">PuTTY</a>
is available for
<a href="http://the.earth.li/~sgtatham/putty/latest/x86/putty-0.56-installer.exe">
free download.</a> </li>
<li>This all depends on at having least a basic installation of
<a href="www.cygwin.org">CygWin</a> as well.</li>
<li>You can select Perl within CygWin, or install another
<a href="http://www.perl.org/">Perl port</a>.</li>
</ul>
<li>Unpack the Emulab exe's and pl's into an install directory of your
choice. The Cygwin bin directory is a good choice, and defaults to
<code>C:\cygwin\bin</code>.</li>
<li>You can copy putty.exe into that directory as well, or make sure the
system path contains the PuTTY install directory.</li>
<li>Make sure that the install directory, and also the Perl directory, are on
your Windows system path, not just your CygWin shell path. Look in
<code>Control Panel / System / Advanced / Environment Variables</code>
and double-click on Path in the lower System Variables pane to
edit.</li>
<li><font size='+1'><b>Windows and Mozilla/Firefox:</b></font>
To associate the handler with the .tbrdp file type in Mozilla/Firefox:
<ul>
<li>Click on a node RDP icon in the Node Options page.</li>
<li>Go to the <code>Open with</code> line and select
<code>Other...</code> from the pull-down list.</li>
<li>Browse to the rdp-mime-winxp.exe application you installed
above.</li>
<li>Once this is working, you can click
<code>Do this automatically<code>.</li>
</ul>
<li><font size='+1'><b>Windows and Internet Explorer:</b></font>
To associate the handler with the .tbrdp file type in Windows:
<ul>
<li>IE associations come from Windows itself. Until that is set up,
IE will just say <code>Unknown file type</code> and offer to save
the .tbrdp file.</li>
<li>You can install the file associations in the registry by downloading and
executing <a href="emulab-mime-winxp.reg">this registry file</a>.
Otherwise, go through the following steps.</li>
<li>Select <code>Save</code> and you will get a
</code>Download complete</code> dialog with an
</code>Open</code> button. Click it.</li>
<li>Click <code>Select the program from a list</code>
and <code>OK</code>.</li>
<li>Finally, you get an <code>Open with</code> dialog with a
<code>Browse...</code> button.</li>
<li>Browse to the rdp-mime-winxp.exe application you installed above
and click <code>Open</code>.</li>
<li>Now you are back on the <code>Open with</code> dialog and
<code>rdp-mime-winxp</code> is on the <code>Programs</code> list.
You could enter a description of "Emulab RDP connector".</li>
<li>Make sure <code>Always use the selected program to open this kind
of file</code> is on.</li>
</ul></li>
<li>To avoid having to type a password to PuTTY, set up an SSH Agent key in
<code>pageant.</code></li>
</ul>
</p>
/* ssh-mime-winxp.exe - Exe wrapper for a Perl script, making
* it acceptable as a file-type opener.
*
* Compile with gcc -o ssh-mime-winxp.{exe,c}
*
* EMULAB-COPYRIGHT
* Copyright (c) 2000-2003 University of Utah and the Flux Group.
* All rights reserved.
*/
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char **argv)
{
if (argc != 2)
printf("Usage: ssh-mime-winxp.exe pcxxx.tbssh\n");
else
{
/* Just pass the file argument on to the Perl script. */
argv[0] = "ssh-mime-winxp.pl";
execvp(argv[0], argv); /* Shouldn't return. */
perror("ssh-mime-winxp.pl");
}
sleep(5);
return 1;
}
#!/usr/bin/perl -w
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2003 University of Utah and the Flux Group.
# All rights reserved.
#
#use English;
#use Getopt::Std;
#
# This is a helper program for your web browser. It allows you to ssh
# to an experimental node by clicking on a menu option in the shownode
# page. Its extremely helpful with jailed nodes, where sshd is either
# running on another port, or on a private IP. Please see the Emulab FAQ
# for instructions on how to install this helper program.
#
# Obviously, it helps to have an ssh agent running.
#
sub usage()
{
print(STDERR "ssh-mime.pl <control-file>\n");
}
my $optlist = "";
my $config;
my $puttypath = "putty.exe";
my $tmpfile = "C:\/temp\/sshcmd";
my $logfile = "C:\/temp\/ssh-mime.log";
# Locals
my $hostname;
my $gateway;
my $port = "";
my $login = "";
#
# Turn off line buffering on output
#
$| = 1;
#
# Log all messages to a file
#
open STDOUT, ">$logfile" or die "Unable to log to $logfile: $!\n";
open STDERR, '>&STDOUT' or die "Can't dup stdout: $!";
#
# Parse command arguments. Once we return from getopts, all that should be
# left are the required arguments.
#
#%options = ();
#if (! getopts($optlist, \%options)) {
# usage();
#}
if (@ARGV != 1) {
usage();
}
$config = $ARGV[0];
#
# Open up the config file. It tells us what to do.
#
open(CONFIG, "< $config")
or die("Could not open config file $config: $!\n");
while (<CONFIG>) {
chomp();
SWITCH1: {
/^port:\s*(\d+)$/ && do {
$port = "-P $1";
last SWITCH1;
};
/^hostname:\s*([-\w\.]+)$/ && do {
$hostname = $1;
last SWITCH1;
};
/^gateway:\s*([-\w\.]+)$/ && do {
$gateway = $1;
last SWITCH1;
};
/^login:\s*([-\w]+)$/ && do {
$login = "-l $1";
last SWITCH1;
};
}
}
close(CONFIG);
#
# Must have a hostip. Port is optional.
#
if (!defined($hostname)) {
die("Config file must specify a hostname\n");
}
#
# Exec an ssh.
#
if (!defined($gateway)) {
exec "$puttypath -ssh $login $port $hostname";
}
else {
open TF, ">$tmpfile" or die "Unable to open $tmpfile\n";
print TF "ssh -tt -o StrictHostKeyChecking=no $port $hostname";
close TF;
exec "$puttypath -A -ssh -t $login -m $tmpfile $gateway";
}
......@@ -9,11 +9,18 @@
<p>
Clicking "SSH to Node" in the Node Options page will send your browser
a "text/x-testbed-ssh" ".tbc" file. In FreeBSD or Linux, you can save
the file and pass it as an argument to <code>ssh-mime.pl</code> or
associate it with <code>ssh-mime.pl</code> in your web browser. You
can download the <code>ssh-mime.pl </code><a href="ssh-mime.pl">Perl
program here</a>.
a "text/x-testbed-ssh" ".tbssh" file.
<ul>
<li> In FreeBSD or Linux, you can save
the file and pass it as an argument to <code>ssh-mime.pl</code> or
associate it with <code>ssh-mime.pl</code> in your web browser. You
can download the <code>ssh-mime.pl </code><a href="ssh-mime.pl">Perl
program here</a>.</li>
<li> In Windows XP or 2000, you have the same choice to save and open the
.tbssh file with a script, or associate it with the script in the browser
so you can just click. See the installation directions <a
href="#windows_install">below</a>.</li>
</ul>
</p>
<p>
......@@ -89,11 +96,70 @@ program here</a>.
</li>
</ul>
<font size='+1'><b>Instructions for Windows:</b></font>
<font size='+1'><b><a name="windows_install"></a>Instructions for Windows:</b></font>
<ul>
<li>Sorry, no windows support yet, although the script is really
simple, and should be trivially convertable to a windows batch
file, or even a windows Perl script if you care to install Perl on
your windows machine.
<li>For Windows XP or 2000, you can download the Emulab Perl programs and wrapper
programs in a <a href="emulab-mime-winxp.zip">zip file here</a>.
It contains {ssh,rdp}-mime-winxp.{c,exe,pl} .
The C programs are tiny wrappers which just exec the perl scripts.</li>
<li><font size='+1'><b>Software dependencies:</b></font></li>
<ul>
<li>The ssh-mime-winxp.pl script uses PuTTY to connect to the Emulab node.
<a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/">PuTTY</a>
is available for
<a href="http://the.earth.li/~sgtatham/putty/latest/x86/putty-0.56-installer.exe">
free download.</a> </li>
<li>This all depends on at having least a basic installation of
<a href="www.cygwin.org">CygWin</a> as well.</li>
<li>You can select Perl within CygWin, or install another
<a href="http://www.perl.org/">Perl port</a>.</li>
</ul>
<li>Unpack the Emulab exe's and pl's into an install directory of your
choice. The Cygwin bin directory is a good choice, and defaults to
<code>C:\cygwin\bin</code>.</li>
<li>You can copy putty.exe into that directory as well, or make sure the
system path contains the PuTTY install directory.</li>
<li>Make sure that the install directory, and also the Perl directory, are on
your Windows system path, not just your CygWin shell path. Look in
<code>Control Panel / System / Advanced / Environment Variables</code>
and double-click on Path in the lower System Variables pane to
edit.</li>
<li><font size='+1'><b>Windows and Mozilla/Firefox:</b></font>
To associate the handler with the .tbssh file type in Mozilla/Firefox:
<ul>
<li>Click on a node SSH icon in the Node Options page.</li>
<li>Go to the <code>Open with</code> line and select
<code>Other...</code> from the pull-down list.</li>
<li>Browse to the ssh-mime-winxp.exe application you installed
above.</li>
<li>Once this is working, you can click
<code>Do this automatically<code>.</li>
</ul>
<li><font size='+1'><b>Windows and Internet Explorer:</b></font>
To associate the handler with the .tbssh file type in Windows:
<ul>
<li>IE associations come from Windows itself. Until that is set up,
IE will just say <code>Unknown file type</code> and offer to save
the .tbssh file.</li>
<li>You can install the file associations in the registry by downloading and
executing <a href="emulab-mime-winxp.reg">this registry file</a>.
Otherwise, go through the following steps.</li>
<li>Select <code>Save</code> and you will get a
</code>Download complete</code> dialog with an
</code>Open</code> button. Click it.</li>
<li>Click <code>Select the program from a list</code>
and <code>OK</code>.</li>
<li>Finally, you get an <code>Open with</code> dialog with a
<code>Browse...</code> button.</li>
<li>Browse to the ssh-mime-winxp.exe application you installed above
and click <code>Open</code>.</li>
<li>Now you are back on the <code>Open with</code> dialog and
<code>ssh-mime-winxp</code> is on the <code>Programs</code> list.
You could enter a description of "Emulab SSH connector".</li>
<li>Make sure <code>Always use the selected program to open this kind
of file</code> is on.</li>
</ul></li>
<li>To avoid having to type a password to PuTTY, set up an SSH Agent key in
<code>pageant.</code></li>
</ul>
</p>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment