ssh/sftp for Windows 2008 Server using CopSSH

Somehow Microsoft missed the boat again. SSH/SFTP is still not included in Windows Server 2008. Only FTP is included with the same functionality that existed in 2003.

CopSSH allows us to add this much needed functionality to a Windows server, or workstation. These instructions assume you are familiar with vim.

On the server we will use:
CopSSH http://www.itefix.no/i2/download
Runas (built in) http://technet.microsoft.com/en-us/library/cc781769.aspx
gVim for Windows http://www.vim.org/download.php#pc

On the client to test:
Putty http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
WinSCP http://winscp.net/eng/download.php

1) Install gvim
2) Install CopSSH using all the defaults.
It will install to "c:\Program Files\copSSH\" There you will find an etc directory that should look familiar if your a BSD/linux user.
3) Open a command prompt (start run > cmd)
4) Use the runas command to launch gvim as an administrator.
runas /user:domain\username "c:\program files\vim\vim72\gvim.exe"

5) In gvim open the sshd_config file located in "c:\program files\copssh\etc"
6) uncomment and configure the following:
Port 22
Protocol 2,1
AddressFamily any
ListenAddress 10.10.11.60
PidFile /var/run/sshd.pid

Save the file.

Openssh SSHD service ( start > run services.msc )


8) Configure the Windows Firewall to allow internal connections on port 22.
Right click on inbound rules, select new rule, Port, TCP, 22, Allow the connection, Domain Private and Public. Give it a proper name and description.

Now everything is setup to work, but you have no users configured. Users should be created locally on the server, and then activated using Start > Programs > COPSSH > Activate a user. This writes a line to the etc/passwd file. You can edit this using runas and gvim. If you want to give the user access to files that exist outside of the copssh folder, use /cygdrive/Drive letter/path . As an example the D:\webs folder would be written as /cygdrive/d/webs .

Make sure you grant the user NTFS permissions to the folder. Use NTFS permissions to permit or deny them movement around the file system.

You can test SSH using putty, and sftp using WinSCP.

  • Elena
    Comment from: Elena
    12/27/11 @ 02:46:30 pm

    Good tutorial, but...
    :( ...bad news!
    CopSSH is not free anymore!
    Copssh, Cwrsync and Nagwin - now as paid solutions !
    https://www.itefix.no/i2/node/12922
    Elena

  • Elena
    Comment from: Elena
    12/27/11 @ 05:16:18 pm

    I use now http://www.bitvise.com/winsshd
    Its free for personal using and stable. ;)
    Elena