Commit a4f8b614 authored by Russ Fish's avatar Russ Fish
Browse files

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

parent 84c4f96b
...@@ -78,9 +78,10 @@ under Cygwin mounts, described below.) <p> ...@@ -78,9 +78,10 @@ under Cygwin mounts, described below.) <p>
<h4><a name="Windows_Passwords"> </a> Windows Passwords </h4> <h4><a name="Windows_Passwords"> </a> Windows Passwords </h4>
A separate <b>Windows password</b> is kept for use only with experiment nodes 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 running Windows. It is presented behind-the-scenes to rdesktop for RDP logins
rdesktop and Samba by our Web interface. Meanwhile, you will need to type it by our Web interface. However, we still haven't figured out how to present it
on each connection. <p> 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 The default Windows password is randomly generated. It's easy to change it to
something easier to remember. <p> something easier to remember. <p>
...@@ -119,17 +120,19 @@ Currently available images are: ...@@ -119,17 +120,19 @@ Currently available images are:
</ul> </ul>
<div style="margin-left: 40px;"> <b>NOTE:</b> The only form of routing that is <div style="margin-left: 40px;"> <b>NOTE:</b> Router nodes can not run Windows
currently supported on Windows is <b><code>rtproto Static-old</code></b>. at present. The only form of routing that is currently supported on Windows
<code>rtproto Manual</code> should work too. Don't put any other is <b><code>rtproto Static-old</code></b>. <code>rtproto Manual</code> should
<code>rtproto</code> statements in your .ns file. <p> 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 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 that it puts in a <code>rtproto Static</code> statement, which you will need
to modify to <code>rtproto Static-old</code>. <p> to modify to <code>rtproto Static-old</code>. <p>
There is more information There is more information on routing in the <a
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> 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 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> changing the node name, to set up the network stack properly. <p>
......
...@@ -17,6 +17,24 @@ include("defs.php3"); ...@@ -17,6 +17,24 @@ include("defs.php3");
$uid = GETLOGIN(); $uid = GETLOGIN();
LOGGEDINORDIE($uid); 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. # Verify form arguments.
# #
...@@ -60,6 +78,7 @@ header("Content-Description: RDP description file for a testbed node"); ...@@ -60,6 +78,7 @@ header("Content-Description: RDP description file for a testbed node");
echo "hostname: $vname.$eid.$pid.$OURDOMAIN\n"; echo "hostname: $vname.$eid.$pid.$OURDOMAIN\n";
echo "login: $uid\n"; echo "login: $uid\n";
echo "password: $pswd\n";
if ($isvirt) { if ($isvirt) {
if ($isremote) { if ($isremote) {
......
...@@ -28,6 +28,7 @@ my $hostname; ...@@ -28,6 +28,7 @@ my $hostname;
my $gateway; my $gateway;
my $port = ""; my $port = "";
my $login = ""; my $login = "";
my $pswd = "";
# #
# Turn off line buffering on output # Turn off line buffering on output
...@@ -72,6 +73,10 @@ while (<CONFIG>) { ...@@ -72,6 +73,10 @@ while (<CONFIG>) {
$login = "-u $1"; $login = "-u $1";
last SWITCH1; last SWITCH1;
}; };
/^password:\s*(.+)$/ && do {
$pswd = "-p '$1'";
last SWITCH1;
};
} }
} }
close(CONFIG); close(CONFIG);
...@@ -94,7 +99,7 @@ if (!defined($hostname)) { ...@@ -94,7 +99,7 @@ if (!defined($hostname)) {
# #
my $rd = 'cd ~fish/misc/rdesktop/rdesktop-1.3.1; ./rdesktop -K -g 1280x1024'; my $rd = 'cd ~fish/misc/rdesktop/rdesktop-1.3.1; ./rdesktop -K -g 1280x1024';
if (!defined($gateway)) { if (!defined($gateway)) {
exec "$rd $login $hostname &"; ### -p $pswd exec "$rd $login $pswd $hostname &";
} }
else { else {
die("No proxying yet.\n"); die("No proxying yet.\n");
......
Supports Markdown
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