Setup Secure FTP (SFTP) With OpenSSH on Windows Server
MWahl | June 5, 2010 | 6:18 pmWindows Server 2008 IIS7 does have support for SFTP unlike IIS6. We are running Windows Server 2003 so IIS7 was not an option. I looked at Filezilla, the setup does not work work well with enterprise level firewalls, etc.
The most simplistic solution was to just use OpenSSH.
1. First open port 22 to the secure Secure FTP Server ip address and apply any needed access lists or static mappings.
2. Download OpenSSH from http://sshwindows.sourceforge.net/download/ and download the binary installer. Once the software is downloaded, click on the executable file to launch the installer.
3. The installation wizard should come up, select next, accept the license agreement, install the Client and Server components, select the destination path.
4. From your server computer Management Console create a user, and a group. add the user to the group. The User name could be sftp and the group be secftp.
5. Create a directory you want your sftp users to access. I created my on the following path:
E:\sftp\sftp
Make sure the OpenSSH service is not running under services. if it is, stop it, otherwise leave it stopped
6. go to RUN and type Regedit and click OK.
navigate to the following registry folder: HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin expand the Mounts v2 folder, and click on /home right click the native file, and click on modify, and add the path of the directory you want your users to have access to. mine is E:\sftp\sftp
7. Create a file named group and passwrd at the following location and don’t put any extension on them.
C:\Program Files\OpenSSH\etc
8. Click on RUN and type CMD and then OK
type the following command on the command prompt:
cd C:\Program Files\OpenSSH\bin
once you switch to the BIN directory type the following commands:
mkgroup -l >> ..\etc\group
and then:
mkpasswd -l -u username >> ..\etc\passwd
on the username option, add the username we created above.
9. From the command prompt, execute the following command to start the service net start opensshd
10. One last thing to do is modify the passwd file C:\Program Files\OpenSSH\etc
Create home directories for your user
In the passwd file, you will notice that the user’s home directory is set as /home/username. Change the location by editing the passwd file with notepad or any other text editor. Only edit the second last entry (/home/username), by replacing it with any directory that you wish to act as that user’s home directory,
using the following syntax:
/cygdrive/c/path_to_the_folder
Testing,U-2K3FS01\SFTP,S-1-5-21-3837532754-3053635440-2016409431-1003:/cygdrive/c/sftp:/bin/switch
Below is an example of my passwd file entry.
FTP:unused_by_nt/2000/xp:1003:513:SFTP

lopsa




