help setting up SFTP SERVER in Filezilla - need step by step or a tutorial

Posted on 2006-04-04
Medium Priority
Last Modified: 2013-12-04
Running Windows 2003 Server
Running Filezilla FTP server

Want to get away from FTP and switch to SFTP using filezilla server.

I need a step by step tutorial to set up filezilla with SFTP on my server.

Thanks in advance.

Question by:vanauden

Author Comment

ID: 16378522
figured it out. thanks anyway

Author Comment

ID: 16388960
Ok, figured the whole thing out: Had to unistall/re-install OpenSSH

Here is how to do the entire thing:  (Window 2003)

Note: I am taking some stuff from http://www.digitalmediaminute.com/article/1487/setting-up-a-sftp-server-on-windows, but not all. I like this tutorial, but it is very incomplete in terms of instructions relating to Windows permissions.

1.     Download OpenSSH for Windows here à http://sshwindows.sourceforge.net/download/

2.     Run the installer and be sure to install both the client and server components.

3.     Create a new windows user and group that will be used for SFTP only.

4.     Now make sure that this new user is a member of the group you just created.

5.     Create your SFTP folder/directory and name it with the exact same name as your new user.

     a.     Do NOT create this folder directly under a hard drive letter because Windows permissions will give the SFTP user access to other drives, and YOU DO NOT WANT THAT!
     b.     I suggest you create a folder for SFTP, then create a SUBFOLDER with the new user’s name. That way, you restrict the user’s group permissions on the subfolder. To be even safer, you then completely deny permissions for this user on the main SFTP folder. More on this later on.

6.     Using WINDOWS Explorer, go to this directory: C:\Program Files\OpenSSH\etc

     a.     Make sure that the file “group” exists. If not, create it with NO extention. (it should be empty)
     b.     Make sure that the file “passwd” exists. If not, create it with NO extention. (it should be empty)

7.     Open the Windows Command Prompt and go to this directory à C:\Program Files\OpenSSH\bin

8.     SIDE NOTE: Local group or user is one that allows permissions for a user logged into the local machine only. (As opposed to being logged in from a domain). By default, users and groups are LOCAL.

9.     If the group you created is a LOCAL group, type: mkgroup -l >> ..\etc\group

10.     If the user you created is a LOCAL group, type: mkpasswd -l -u sftpuser >> ..\etc\passwd

11.     This is one IMPORTANT point where I diverge from the setup notes in the article. You need to edit the registry BEFORE starting your SFTP service. Sometimes Windows just will not let go of settings, and if you start the service now, it will probably be started with incorrect settings (if you followed my instructions). If you started it before reading this, stop the service, follow my instructions bolow, then start the service again. (Back up your registry first.)

     a.     In your passwd file, you now have a listing of the default SFTP directory for your Windows user. You need to change the main folder (/home) location. The README file in OpenSSH provides the best method for doing this (clipped as follows).
     b.      To change the Windows directory /home corresponds to, you will need to edit a registry entry under HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/home.
     c.     The value of the key named "native" is the directory that /home is. If you want all your users to enter in a directory on your machine called F:\Users, change "native" to read F:\Users.
     d.     By default, each user will then be placed in the directory F:\Users\username, where username is the name of the user account.

12.     Start the OpenSSH server (service) by typing: net start opensshd

     a.     You can stop it by typing: net stop opensshd

13.     On your firewall, open port 22. This is the default SFTP port.

14.     Now you can test your SFTP server using a client from another computer. I use Filezilla. In Filezilla, create a new (S)FTP site as follows:

     a.     Host (the IP or domain name of your server)
     b.     Port 22
     c.     Server Type: SFTP (using SSH2) (It’s backwards compatible to SSH)
     d.     Logon Type: Normal
     e.     User: Windows username for the user you created
     f.     Password: Windows password for the user you created
     g.     Connect and it should work.
     h.     Note that the user has access to the entire server at this point… that’s not good.

15.     SFTP does not provide a method for locking a user to his/her home directory
     a.     Now you MUST set your Windows permissions on the folder you created with the new user’s name to LIMIT this user to this folder.
     b.     My example folder: D\sftp\sftpuser.
     c.     Right-click on the sftpuser folder and select Properties.
     d.     Click the Security tab.
     e.     Click the “Add” button and add your USER to the folder
     f.     Here are the permissions I gave the user:
          i.     List folder contents
          ii.     Read
          iii.     Write

     g.     Now right-click on the “sftp” folder and select properties

     h.     Click the Security tab.

     i.     Click the “Add” button and add your GROUP to the folder

     j.     DENY ALL PERMISSIONS for the Group (checkmark in Deny Full control).

     k.     Now your SFTP user will be able to get into the SFTP folder and subfolders only.

16.     Now test your SFTP again. It should work.

Accepted Solution

GranMod earned 0 total points
ID: 16394200
Closed, 500 points refunded.
The Experts Exchange
Community Support Moderator of all Ages

Expert Comment

ID: 25457151
I'm trying to do the exact same thing but getting stuck at;
9.     If the group you created is a LOCAL group, type: mkgroup -l >> ..\etc\group

10.     If the user you created is a LOCAL group, type: mkpasswd -l -u sftpuser >> ..\etc\passwd
 I keep getting ;
 "the syntax of the command is incorrect"
 c:\program files (x86)\openssh\bin mkgroup -| >> ..\etc\groups
server 2008 standard

Expert Comment

ID: 25867251
OK, so this Filezilla server on WIndows is SFTP or SSH console ?

Featured Post

When ransomware hits your clients, what do you do?

MSPs: Endpoint security isn’t enough to prevent ransomware.
As the impact and severity of crypto ransomware attacks has grown, Webroot fought back, not just by building a next-gen endpoint solution capable of preventing ransomware attacks but also by being a thought leader.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SHARE your personal details only on a NEED to basis. Take CHARGE and SECURE your IDENTITY. How do I then PROTECT myself and stay in charge of my own Personal details (and) - MY own WAY...
No security measures warrant 100% as a "silver bullet". The truth is we also cannot assume anything but a defensive and vigilance posture. Adopt no trust by default and reveal in assumption. Only assume anonymity or invisibility in the reverse. Safe…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question