Commit a4f8b614 authored by Russ Fish's avatar Russ Fish

Pass the windows password to rdesktop for RDP auto-login from *nix.

parent 84c4f96b
......@@ -78,9 +78,10 @@ under Cygwin mounts, described below.) <p>
<h4><a name="Windows_Passwords"> </a> Windows Passwords </h4>
A separate <b>Windows password</b> is kept for use only with experiment nodes
running Windows. It will eventually be presented behind-the-scenes to
rdesktop and Samba by our Web interface. Meanwhile, you will need to type it
on each connection. <p>
running Windows. It is presented behind-the-scenes to rdesktop for RDP logins
by our Web interface. However, we still haven't figured out how to present it
to Windows for the Samba mount of your home directory under an ssh login, so
you will still need to type it on each ssh connection. <p>
The default Windows password is randomly generated. It's easy to change it to
something easier to remember. <p>
......@@ -119,17 +120,19 @@ Currently available images are:
</ul>
<div style="margin-left: 40px;"> <b>NOTE:</b> The only form of routing that is
currently supported on Windows is <b><code>rtproto Static-old</code></b>.
<code>rtproto Manual</code> should work too. Don't put any other
<code>rtproto</code> statements in your .ns file. <p>
<div style="margin-left: 40px;"> <b>NOTE:</b> Router nodes can not run Windows
at present. The only form of routing that is currently supported on Windows
is <b><code>rtproto Static-old</code></b>. <code>rtproto Manual</code> should
work too. Don't put any other <code>rtproto</code> statements in your .ns
file. <p>
If you built your experiment .ns file with the <i>NetBuild</i> GUI, be aware
that it puts in a <code>rtproto Static</code> statement, which you will need
to modify to <code>rtproto Static-old</code>. <p>
There is more information
on routing in the <a href="http://www.emulab.net/tutorial/docwrapper.php3?docname=tutorial.html#Routing"> Routing Section of the Emulab Tutorial. </a><p> </div>
There is more information on routing in the <a
href="http://www.emulab.net/tutorial/docwrapper.php3?docname=tutorial.html#Routing">
Routing Section of the Emulab Tutorial. </a><p> </div>
Notice that Windows reboots an extra time after first swap-in on a node, after
changing the node name, to set up the network stack properly. <p>
......
......@@ -17,6 +17,24 @@ include("defs.php3");
$uid = GETLOGIN();
LOGGEDINORDIE($uid);
# Get the windows password from the database, or use a random default.
$query_result =
DBQueryFatal("select usr_pswd, usr_w_pswd from users where uid='$uid'");
$row = mysql_fetch_array($query_result);
if (strcmp($row[usr_w_pswd],""))
$pswd = $row[usr_w_pswd];
else {
# The initial random default for the Windows Password is based on the Unix
# encrypted password, in particular the random salt if it's an MD5 crypt,
# consisting of the 8 characters after an initial "$1$" and followed by a "$".
$unixpwd = explode('$', $row[usr_pswd]);
if (strlen($unixpwd[0]) > 0)
# When there's no $ at the beginning, it's not an MD5 hash.
$pswd = substr($unixpwd[0],0,8);
else
$pswd = substr($unixpwd[2],0,8); # The MD5 salt string.
}
#
# Verify form arguments.
#
......@@ -60,6 +78,7 @@ header("Content-Description: RDP description file for a testbed node");
echo "hostname: $vname.$eid.$pid.$OURDOMAIN\n";
echo "login: $uid\n";
echo "password: $pswd\n";
if ($isvirt) {
if ($isremote) {
......
......@@ -28,6 +28,7 @@ my $hostname;
my $gateway;
my $port = "";
my $login = "";
my $pswd = "";
#
# Turn off line buffering on output
......@@ -72,6 +73,10 @@ while (<CONFIG>) {
$login = "-u $1";
last SWITCH1;
};
/^password:\s*(.+)$/ && do {
$pswd = "-p '$1'";
last SWITCH1;
};
}
}
close(CONFIG);
......@@ -94,7 +99,7 @@ if (!defined($hostname)) {
#
my $rd = 'cd ~fish/misc/rdesktop/rdesktop-1.3.1; ./rdesktop -K -g 1280x1024';
if (!defined($gateway)) {
exec "$rd $login $hostname &"; ### -p $pswd
exec "$rd $login $pswd $hostname &";
}
else {
die("No proxying yet.\n");
......
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