[MLton-user] SSH (and CVS) for Windows guide :)

Anoq of the Sun anoq@HardcoreProcessing.com
Sun, 16 Nov 2003 19:43:34 +0200


This is a multi-part message in MIME format.
--------------C378ED67CD8EFD4C734F3A46
Content-Type: text/plain; charset=iso-8859-7
Content-Transfer-Encoding: 7bit

Hello!


I just found the saviour for using SSH on Windows!

Someone has been kind enough to create an OpenSSH package
for Windows which does not require the entire Cygwin installation:
http://lexa.mckenna.edu/sshwindows/

And it works on Windows NT! :)

I have attached my guide of what I did to get this to work
on Windows NT. Something like this is needed by the
process of cross-compiling programs with MLton. If
you want to include this guide (or parts of it?) in
the MLton docs - please do!

And while we are at it - many developers use CVS. If you
have a CVS-server on Linux and you want to access CVS from
Linux - I also attached a guide of how I got that to
work on Windows XP (a few months ago). This is using
the Cygwin installation for SSH
(which didn't work on Windows NT for me...). There are
also descriptions of some SSH implementations which didn't
work for me for various reasons.

I'm sure you can combine those 2 guides to get your
ideal SSH and CVS setups for Windows :)

I hope these guides might help someone :)


Cheers
-- 
http://www.HardcoreProcessing.com
--------------C378ED67CD8EFD4C734F3A46
Content-Type: text/plain; charset=iso-8859-7;
 name="InstallingOpenSSHForWindows.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="InstallingOpenSSHForWindows.txt"

What I did for installing OpenSSH for Windows under Windows NT was the following:
--------------------------------------------------------------------------------------------------------------------

1) Create the desired users under Windows. On Windows NT this is done
with the program "User Manager" under "Administrative Tools" in the Start menu.
I created the users anoq and root to avoid having to supply a user name when
using ssh from Linux. I added them to the groups "Users" and "Power Users".
The add-cross script in MLton does (currently) not allow supplying a user name.

2) Maybe you should reboot your computer at this point - not sure...

3) Install OpenSSH for Windows from
    http://lexa.mckenna.edu/sshwindows/
    by using the setup program supplied from there.

4) Do as instructed in the readme of the OpenSSH distribution.
For me this meant running these commands:

  a) cd to the  bin/  directory under the newly installed OpenSSH directory
  b) mkgroup -l >> ..\etc\group
  c) mkpasswd -l >> ..\etc\passwd

NOTICE: This step c) adds ALL Windows users to the passwd file.
This may be undesirable but I couldn't get the following command to work!
  mkpasswd -l -u anoq >> ..\etc\passwd

(because mkpasswd -l -u anoq did not give any output at all!)

  d) You might have to reboot your computer at this point - not sure.
  e) If the opensshd server is not already running (e.g. after the reboot)
      you must start it (still from the bin directory) with:
      net start opensshd

5) You should now be able to log in as e.g. anoq or root from another machine with ssh.
     If 10.0.0.3 is the IP address of the Windows machine then this should work from another machine:

    ssh 10.0.0.3

--------------C378ED67CD8EFD4C734F3A46
Content-Type: text/plain; charset=iso-8859-7;
 name="CVS_SSH_Windows.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="CVS_SSH_Windows.txt"

SSH on Windows NT / XP:
-----------------------
1) I tried with win-ssh. No use, since this is SSH1.

2) I tried TTSSH, which is a plugin to Tera Term Pro...
   This also only seems to support SSH1.

3) I tried PuTTY - using the plink command. It uses SSH2 at least and normal
   command line access works.
   Regarding CVS I got as far as to having problems with supplying password for CVS.
   It neither worked with a .cvsrc file nor a public / private key password authentication.

   Here's how I configured the environment variables for PuTTY with CVS:
     PATH: Add the path to the putty binaries
     CVS_RSH=plink -sw -pl <password>   (this is one attempt at supplying password which didn't work)
     HOME=C:\Home\Anoq\                      (another attpemt at supplying password which didn't work)
   For password authentication I generated private and public keys with the utility puttygen from PuTTY and
   threw the public key on the Linux CVS server and the private key in $HOME set above. Also
   you have to start pageant on the private key as a privatekey server. Alas, none of this worked.

4) Installing Cygwin and using the ssh supplied with Cygwin works! Also with CVS!

Environment variables in ControlPanel->System->Environment for Cygwin:
  PATH: I have added the path to bin under directory where Cygwin is installed.
        This also gives me the wonderful Unix-commands like ls, cp, rm etc.

CVS on Windows NT / XP:
-----------------------
I installed the CVS-1.11.5 client on Windows XP (also works for NT).
(even though the CVS repository on my Debian Linux is only 1.10.7)

I am setting these variables in ControlPanel->System->Environment:

PATH: I have added the path to where cvs.exe is placed.
CVS_RSH=ssh
CVSEDITOR=notepad
CVSROOT=:ext:anoqcvs@10.0.0.3:/home/anoqcvs/cvsanoq

The variables HOMEDRIVE and HOMEPATH is the drive and path to where
the file .cvsrc is placed.

To avoid typing a password every time:
Create a file .cvspass containing the password and
set the environment variable:
CVS_PASSFILE=X:\Misc\cvs\.cvspass

It might also be possible to specify a hostname instead of an IP adresse
by first setting either the environment variables:
HOMEDRIVE=X:
HOMEPATH=\Misc\cvs\

Or one of the environment variables:
HOME=C:\Misc\cvs\   or   HOMEPATH=C:\Misc\cvs\

And then create a directory:
.ssh/

Under $HOMEPATH

and create a file under .ssh/

known_hosts

Containing e.g. the line:

AnoqCVS.HcP.lan	10.0.0.3	AnoqCVS

--------------C378ED67CD8EFD4C734F3A46--