Setting up SFTP on Windows 2008

Recently, I had a task assigned to me to get SFTP up and running on a Windows 2008 server. I did some Googling and found a few resources, but only by combining the various bits of information was I able to get it up and running. I thought I’d throw it all together into a blog post, in the hopes that it will help someone else out.

Requirements

You will need to download the latest Cygwin package from cygwin.com (there’s a link to setup.exe halfway down the first page). You’ll also need to have administrator access to the Windows 2008 server.

Getting Started

After you’ve downloaded Cygwin’s setup.exe, right-click it and Run As Administrator. Choose to Install from Internet, keep the defaults for Root Directory and Install For All Users and leave the Local Package Directory at the default path. If you’re behind a proxy, you’ll want to use Internet Explorer’s settings, or enter the proxy information. If not, direct connection will work great. Choose a mirror (I chose the one from kernel.org), and click OK for the warning about upgrading Cygwin (since this is theoretically your first time to install it). On the package selection page, type SSH into the Search box, then expand the Net selection. Click on openssh to select the binary package only. Select the required dependent packages on the next screen and wait for the installation to finish.

Configuration

After the installation is completed, find the Cygwin Bash Shell icon (should be on your Start Menu or Desktop), and right-click to Run As Administrator. You’ll see some initial configurations running, then will be presented with a prompt. At the prompt, enter ssh-host-config to get started. You’ll be presented the wizard below. Feel free to answer as I’ve listed, or change as needed.

  1. Should privilege separation be used? <yes>
  2. Should this script attempt to create a new local account ‘sshd’? <yes>
  3. Do you want to install sshd as a service? <yes>
  4. Enter the value of CYGWIN for the daemon <> (this is the service name)
  5. Do you want to use a different name (privileged acct cyg_server) <no>
  6. Create new privileged user account ‘cyg_server’? <yes>
  7. Please enter the password? [your choice]
  8. Reenter the password
  9. Setup is complete. Enter net start sshd at the prompt to start the service.

Users & Groups

By default, all local groups and local users will be added to C:\Cygwin\etc\group and C:\Cygwin\etc\passwd, respectively. You can add additional local groups (created after Cygwin install/sshd configuration by using the following command at the Cygwin Bash Shell prompt:

  • mkgroup -l -g “Group Name” >> /etc/group

You can also add domain-based groups with:

  • mkgroup -d -g “Group Name” >> /etc/group

Add additional local or domain-based users in much the same way:

  • mkpasswd -l -u “username” >> /etc/passwd
  • mkpasswd -d -u “username” >> /etc/passwd

Home Directories

By default, all users you add to the passwd file (or users present during initial configuration), will be mapped to /home/username (within Cygwin Bash Shell), or C:\Cygwin\home\username in Windows.

If you wish to change the home directory for a particular user, then use a text editor to edit the home directory path in /etc/passwd. If you wish to point the user’s home directory to another folder within Windows, then you must use Cygwin’s cygdrive to do so. As an example, the C:\ drive is known to Cygwin as /cygdrive/c. The D:\ drive is /cygdrive/d, and so on. If you want to set the home directory to point to D:\directory, then the appropriate home directory path is /cygdrive/d/directory. Save and close /etc/passwd when you are done.

Testing

If you’ve made any changes to /etc/group, or /etc/passwd, then you’ll want to restart the sshd service for the changes to take effect. If not, make sure you’ve started the sshd service before moving forward with verifying that everything works as expected.

Fire up your favorite SFTP capable client (I prefer FileZilla or WinSCP), and point it towards your new SFTP server. Be sure to use a user whose group exists in /etc/group, and is listed in /etc/passwd.

Comments

  1. This clothing item is basically a one-piece fabric changed to an outfit that can fit babies of numerous sizes.
    An automotive wholesaler is often a company that either sells full automobiles or automobile parts wholesale.
    It is true, that stores swll existiing stock for affordable
    to make room for brand spanking new stuff.

  2. Be sure to become acquainted with the retailer’s policy oon returns and
    exchanges before buying anything. Vitamin make-up is advisable when sed by employing a appropriate buffing
    cosmetic wash and making use of proper ‘buffing’ approach.
    With a little practice to master the natural look, very
    first time and learning how to pick the best products which is usually to say,
    people who better suit your skin type, makeup is not really a
    chore to suit your needs .

  3. Hi there, You’ve done a fantastic job. I’ll certainly digg it and personally recommend to my friends.

    I’m confident they will be benefited from this site.

  4. Dieses hätte von Seiten Lexer (1931) erkannt Entstehen
    Geübtheit. Es kann, schon hier, angenommen
    werden, dass er welches Honorieren auf Abstand bleiben
    wollte. Neben Deutsche Mark (etwas für gut/schlecht) befinden der Plastischen Chirurgie
    als Wiederherstellungs-Chirurgie/-Dreh hat
    er die bei DEM Begriff welcher Plastischen Chirurgie
    übergeordnet notwendige „Kunst des Heilens“
    (Porter 2000) nicht berücksichtigt.
    Aufgrund der Tatsache dasjenige Nichtbeachten dieser in Deutsche Mark Wort
    „plastisch“ immanenten ästhetischen Geltung
    konnte er die wesentlichen, differenzierenden
    u. a. speziellen Eigenschaften solcher Plastischen
    Chirurgie manipulieren. Indem blieb von Seiten ihm
    jenes Grundregel welcher Einheit dieser Chirurgie
    wie allgemeines
    Areal unübertroffen. Dasjenige abstrakte
    Satzpartikel „Kunst“ (Kluge 1989) blieb hierbei solcher allgemeinen
    Chirurgie (sich) offenhalten.
    Mit Aussicht hinauf Chip dargestellte Geschichte erweist
    sich, dass ein Großteil jener seitens Lexer (1931)
    definierten „Wiederherstellungschirurgie“ anhängig
    dem Areal dieser Plastischen Chirurgie angegliedert
    worden war. Dieffenbach, ordentlicher Hochschulprofessor
    zu Händen Chirurgie an solcher Königlichen Universität in
    Berlin, hatte die „Plastische Chirurgie“ (1845–
    1848) (▶ Abschn. 2.3) charakterisiert
    » … denn den Wiederersatz (die Wiederherstellung)
    eines unwiederbringlich gegangenen oder die
    Produktion der Form eines verstümmelten
    Theils des menschlichen Körpers (angeborene
    oder erlittene Deformität) zum Thema machen wir
    Plastische Chirurgie. Ein großes, wichtiges,
    künstlerisches Gebiet, auf DEM Chip Physiologie
    der Chirurgie die Hand ausreichend Dieffenbach
    1845/48, S. 14).

  5. Nunmehr scheint
    Chip Spezialisierung in solcher Handchirurgie
    neue Möglichkeiten zum Besten von die Erläuterung
    der rheumatoiden Arthritis zu eröffnen. Die
    operativen (sich) verfahren dieser frühen Synovektomie
    zur Heilverfahren und Arthroplastien und
    Sehnenumlagerungen zur Rehabilitation,
    sind damit gute Resultate zu ehrerbietig. Enge
    Zusammenarbeit in unserer Klinik zwischen
    den Rheumatologen unter anderem Plastischen
    Chirurgen führt zu zahlreichen Patienten
    eingeschlossen aggressiv deformierten Händen, welcher Handchirurg
    hat Chip Vermögen deren Betrauern zu
    dämpfen. Chip ulnare Deviation solcher Finger
    ist eine der häufigsten ‚krüppelhaftesten‘
    Deformitäten. Jene beginnt mit Unvermögen
    des Zeigefingers beim Spitzgriff wider die
    in Anlehnung an ulnar drückenden, deformierenden
    Lebhaftigkeit zu funktionieren. Entzündliche Erweiterung
    der Kapseln jener Fingergrundgelenke, beginnend
    einschließlich Deutsche Mark Zeigefinger, gefolgt
    seitens den
    Anderen, deformiert allmählich Chip Gelenke.
    Sehnenumlagerung u. a. Besserung
    jener Seitenbänder folgsam eine nur
    vorübergehende Verbesserung.
    Abschließend folgt Chip Erklärung der 1959
    von Bäckdahl u. a. Myrin (1961) begonnenen stabilisierenden
    Osteoplastiken noch dazu solcher 1963 seitens
    Bäckdahl veröffentlichten Testlauf jenseits dieses „Caput
    ulnaris Syndrom“.
    Nahe dem gesamten Schriften des Vortrages seitens
    Ragnell (1901–1984) handelt es sich um die
    als Auf Grund der Tatsache zum Vorteil von seinen Lehrer
    gehaltene „Gillies
    Memorial Lecture“, die 1965 am „University
    College Oxford“ im Juli 1964 an Deutsche Mark „Summer
    Meeting“ solcher „British Association of Plastic
    Surgeons“ gehalten wurde. Sie wird unterdies zum wiederholten Male
    zitiert, auch denn sie aus nicht geraume Zeit ehemaliger Geliebter
    Zeitspanne den humanistischen Gespenst der akademischen
    Überlieferung der hippokratischen Plastischen
    Chirurgie beweist. Zu erwarten ist, dass
    dieser Geist zu Gunsten von Chip gesamte Plastische Rekonstruktive
    und Ästhetische Chirurgie „in Nebenläufigkeit
    von Vergangenheit neben Zukunft“ Fundus
    Gutschrift wird.

  6. The reliable company continues to be serving an entire and accurate specifics of the fashion. While watching the enhanced demand
    off oold aged people’s demand, the fashion world is targeting the seniors wwith latest trends.

    The seasonal collectiopn gains more demand as each piece off colntent give importance
    to comfort past the look.

  7. Customers are choosing interne shopping of mobiles, tablets as well as other
    gadgets too. A approach to fame – When the Grand Prix originated,
    the earlly races were for auto producers only. Check the
    qualkity of these website this goes back to reputation, would they sell off aan undesirable quality site.

  8. If you might be pear-shaped (with larger hips andd legs) avopid
    any clothing that could emphasize thos areas.
    Considering how costly a whole new suit is, it is vital that particular take good care from the suit they has.

    This will help yyou to purchase what you can only afford
    so that yoou just are left using the running capital.

  9. Dig into chorfd progressions and appreciate how they affect
    the price off a song. There has become a variety
    of work-boats avaiolable on the seas and they’re
    entrusted many different workk tasks by big business owners.
    Theey will take cash, merchandise as well as your supplies; remember
    everything nice tissue pzper and gift bags you paid dearly for.

  10. There is not sufficient space iin this post to adequately cover this technique
    oof selling yyour business. When another client likes your pin, she or he will truly remember to
    scan and call at your site. Whether you’re a physical
    or digial business, accounting is important; it really is in analogy similar tto the heart of your organism.

  11. If you really want to you cokuld make youyr money double with currency dealing plan application, then it’s
    a must you will wannt to do your essential research and require to obain the perfect time to
    utilize ttading currency application. Video echnology usually trend
    additional on the internet now, as witgh integration of cameras and high
    quality monitors, it’s most certainly not surprising automobile
    a great deal cheaper than decade ago, it is because off the impact in our economical climate.
    8 trillion due iin 2010, as well aas Italy, France,
    Germany, Canada, Brazil, UK, China and India rounding out the top
    ten to be able, wth China aat #9 with $121 billion due in 2012
    and India at #10 with $57 billion.

  12. If some one desires expert view concerning blogging and site-building then i propose him/her to go to see this web site, Keep up the pleasant work.

  13. There has been a long issue about the type of
    legal degree that oone can get. There are even instances when students were enrolled few months after official date and changed internship graphics and exchange programs.
    The other is usually to be described as a legal publisher
    andd this entails anyone to be publishing of materials including textbooks, reference books and soo on therefore forth.

  14. This picture inspires and challengees me to be the best
    I caan be like a keynote speaker but in addjtion reminds me to relish
    thhe trip or as Wongchu says. Such form is submitted over the online portal in the resource provider.
    These individuals are expeerienced and educated in their field and know
    a lot better than anyone the way to handle anyy electrical related task.

  15. Hmm it looks like your website ate my first comment (it was extremely
    long) so I guess I’ll just sum it up what I submitted and say, I’m thoroughly enjoying your blog.
    I too am an aspiring blog writer but I’m still new to the whole thing.
    Do you have any recommendations for first-time blog writers?
    I’d genuinely appreciate it.

  16. Perform gentle sequences of actions involving changes of direction, stopping/beginning
    and leaping to simulate the action of a basketball sport.

  17. Would love to perpetually get updated great blog! http://www.3dprostatecure.com/page.php?cata_id=53&id=288

  18. Es folgten jährliche Kongresse in
    London darüber hinaus Mailand. Anlässlich der dritten Konferenz
    1938 in Mailand wurde vonseiten Sanvenero Rosselli
    Chip neue internationale Blatt Plastica
    Chirurgica hrsg.. Er veranstaltete kombinieren
    Lehrkurs zu Händen das Seminar vonseiten Plastischen Chirurgen
    in Italien. Eine zusätzliche Auflage konnte
    bezüglich des Beginns des 2. Weltkrieges nicht mehr
    erfolgen (Converse 1964,1977 mehr noch 1967). Converse
    schreibt abschließend:
    » Solcher internationale Konferenz der ‚European
    Society of Plastic Surgery‘ war dieser
    Glanzleistung der Entstehung jener Plastischen
    Chirurgie vor DEM 2. Weltkrieg … Er erbrachte
    1936 Meilensteine der Fortschritte
    zu Händen die Anerkennung der Vorhandensein dieses
    neuen Zweigs jener Chirurgie, alles andere als bloß in solcher
    Öffentlichkeit sondern außerdem für die akademische
    Welt (Converse 1977).
    4.2.4 Besondere Beiträge
    in jener Wissenschaftliche Literatur zwischen
    den Weltkriegen
    Entscheidende Beiträge z. Hd. den Fortschritt solcher
    Plastischen Chirurgie sind von den alsdann
    genannten Autoren in jener Phase zwischen den beiden
    Weltkriegen (1918–1939) geleistet worden.
    Verbrennungen
    Yngve Zottermann wird in puncto seines im Vorhinein
    1933 elektrophysiologisch erbrachten Nachweises
    jener unterschiedlichen Leitungsgeschwindigkeit
    involvierter schmerzleitender Belästigen von Seiten Voigt
    (1982) im Mitgliedsbeitrag zur Monographie Die Verbrennungskrankheit,
    Entstehung, Fortschritt und Therapie
    berücksichtigt. Die Befund solcher unterschiedlichen
    anatomisch im Übrigen physiologisch bedingten
    Schmerzleitungsgeschwindigkeiten führte zur
    einer wissenschaftlichen obendrein kühl erprobten
    Indikation welcher medikamentösen Schmerzbehandlung
    Brandverletzter.

  19. Hi there I am so glad I found your site, I really found you by mistake, while I was looking
    on Aol for something else, Anyhow I am here now and would
    just like to say thank you for a remarkable post and a
    all round entertaining blog (I also love the theme/design), I don’t have time to read through it all at the
    minute but I have bookmarked it and also included your RSS feeds, so when I have time
    I will be back to read more, Please do keep up the excellent work.

  20. Quality articles is the crucial to interest
    the users to pay a visit the web page, that’s what this site is providing.

  21. I’m still learning from you, but I’m improving myself.
    I certainly love reading all that is posted on your site.Keep the tips coming.
    I loved it!

  22. What i do not realize is in truth how you are now not actually much more well-liked than you
    may be right now. You are so intelligent. You know thus considerably in terms of this subject,
    produced me individually consider it from numerous varied angles.
    Its like women and men aren’t involved unless it’s one thing to accomplish with Woman gaga!
    Your individual stuffs nice. At all times maintain it up!

  23. This post offers clear idea in support of the new people of blogging, that genuinely
    how to do running a blog.

  24. I like this weblog very much so much excellent info.

  25. Hi I am so thrilled I found your blog, I really found you by
    accident, while I was looking on Yahoo for something else, Anyhow I am here now
    and would just like to say thanks for a remarkable
    post and a all round thrilling blog (I also love the theme/design),
    I don’t have time to look over it all at the moment but I have saved
    it and also added your RSS feeds, so when I have time I will be back to
    read a great deal more, Please do keep up the fantastic work.

  26. fantastic issues altogether, you just received a new
    reader. What would you suggest in regards to your publish that
    you simply made some days in the past? Any sure?

  27. There’s certainly a great deal to find out about this topic.

    I love all of the points you made.

  28. Hi colleagues, good post and nice urging commented at this place, I am truly enjoying by these.

  29. You should take part in a contest for one of the most useful blogs on the
    net. I most certainly will highly recommend this website!

  30. To compete with unlimited choices from opponents within the wi-fi business, Enhance Cellular introduced on January 15,
    2009, that it might launch a Monthly Unlimited Plan.

  31. Hi everyone, it’s my first go to see at this web page, and article is genuinely fruitful in support of me,
    keep up posting such articles.

  32. With havin so much content and articles do you ever run into any issues
    of plagorism or copyright violation? My site has a
    lot of unique content I’ve either written myself or outsourced but it
    looks like a lot of it is popping it up all over
    the internet without my permission. Do you know any methods to help stop content from being ripped off?
    I’d genuinely appreciate it.

  33. Thanks designed for sharing such a pleasant thinking, paragraph is good, thats why i have
    read it entirely

  34. Great blog you’ve got here.. It’s hard to find good quality writing like yours these days.
    I seriously appreciate individuals like you! Take care!!

  35. It’s not my first time to pay a quick visit this site, i am visiting this site
    dailly and take nice data from here everyday.

  36. This piece of writing will assist the internet viewers for creating new webpage or even a weblog from
    start to end.

  37. Attractive section of content. I just stumbled
    upon your blog and in accession capital to claim that I get actually enjoyed account
    your blog posts. Anyway I will be subscribing in your feeds and
    even I success you get entry to persistently quickly.

  38. Remember that the price is additionally suffering from the price
    in order to check first the free sizes given which has a specific value.
    Variety and use of files ought to be the first consideration. Nevertheless Avatar
    beat Titanic with 3D IMAGES effects a short while
    ago, Titanic continues to be viewed as an eternal classic
    in video industry.

  39. Hi there colleagues, its enormous paragraph regarding tutoringand entirely defined,
    keep it up all the time.

  40. What i don’t realize is in truth how you’re now not really a lot more neatly-preferred than you might be right now.
    You are very intelligent. You know thus considerably relating to this matter, produced me personally believe
    it from numerous various angles. Its like men and women aren’t fascinated except
    it is one thing to do with Woman gaga! Your own stuffs outstanding.
    All the time take care of it up!

  41. Wow, amazing blog format! How long have you been running a blog for?
    you made running a blog glance easy. The total glance of your web site is great,
    as neatly as the content!

  42. 「きょうは何となしに、自由にしとこうかな?」カナフレックス2chさんをお昼に誘い出すつもりで連絡を入れたら、第一声がこれでした。

    その事から、きょう、実にに久々にカナフレックス2chさんに逢いました。

  43. I have noticed you don’t monetize your blog, don’t waste your traffic, you can earn extra bucks every month because you’ve got high quality
    content. If you want to know how to make extra money, search for: best adsense alternative Wrastain’s
    tools

  44. Thank you for another informative site. Where else may I am getting that type of information written in such
    an ideal approach? I’ve a mission that I am simply now working on, and I’ve been at the glance out for such info.

  45. What’s up, I would like to subscribe for this web site to get latest updates, therefore where can i do it
    please help out.

  46. This page truly has all the information and facts I wanted about this subject and didn’t
    know who to ask.

  47. New Year Celebration kits and bulk halloween and fiesta.

  48. It’s an remarkable post for all the web visitors;
    they will obtain benefit from it I am sure.

  49. RScottyH43 says:

    One more thing. [still running as admin] Hmm, so I’ve tried cd’g into /etc/group and /etc/passwd, respectively and I am met with, “-bash: cd: /etc/group: No such file or directory”

    🙁 Will they only exist after creating a group and/or password?

    And one last thing. Just for sanity-sake, here’s a thought: I wish for a group of folks to be able to sftp into the box and use a particular folder/dir. I simply could create a group for them, yes, and then assign the group access to that particular folder, right? So, basically ‘bob’, ‘joe’, and ‘sally’ should be able to sftp and put stuff in folder ‘ftp_here’.

    Thanks in advance.

    • RScottyH43 says:

      Ok. I answered my own question! I now see these files after running mkgroup and mkpasswd. So, now I take it the info contained in these files is pulled from Active Directory?

  50. RScottyH43 says:

    Thanks much for this walk-through!

    Tried different solutions and finally came upon Cygwin, which worked! Although, just a tidbit of info, Cygwin-32 seems to setup as expected vs. Cygwin64, which gave me all sorts of trouble. Also, configuration now asks, “Should StrictModes by used?” Answer ‘yes’, then continue as noted above.

  51. Michael says:

    I am trying to isolate a local user so they can only access their home location with no access to other folders in the root. How can this be done as I am running into so issues trying to do this.

  52. craig88 says:

    Once you get sftp setup you may encounter these problems:
    1) admin user can login but regular users cannot. Is your server a domain controller? :
    http://serverfault.com/questions/159272/cant-login-to-cygwin-sshd-server-with-a-non-administrator-user-account

    2) allow sftp access but not shell access:
    edit /etc/sshd_config and add per user (or group) force command :
    Match User ftpuser
    ForceCommand /usr/sbin/sftp-server -l INFO

    3) restrict your sftp users to only their own directory
    the standard method is with chrootdirectory but that doesn’t seem to work on cygwin
    I don’t have that many users so I set windows security deny permissions for all directories but their own.

    after all that I was wishing i’d tried out this sftp server:
    http://www.coreftp.com/


  53. Kuldeep:

    Hi ,
    I have edited the password file to point to D:\some_directory.
    But still it is pointing to its old home directory.
    Note: I have tried restarting the service, after editing the password file.
    Please help.
    RegardsKuldeep.

  54. Hi ,

    I have edited the password file to point to D:\some_directory.

    But still it is not pointing to its old home directory.

    Note: I have tried restarting the service, after editing the password file.

    Please help.

    Regards
    Kuldeep.

  55. Hi,

    Thanks so much for this “how to”.
    It worked 100% for me.

    Sven

  56. Hello,

    Thank you for psoting this tutorial. well explained. I tried to install SFTP as per your tutorial and am struck after this:
    ————————-
    Find the Cygwin Bash Shell icon (should be on your Start Menu or Desktop), and right-click to Run As Administrator. You’ll see some initial configurations running, then will be presented with a prompt. At the prompt, enter ssh-host-config to get started.
    —————–

    I got the prompt and entered ssh-host-config and it gave me an error “bash: ssh-host-config: command not found”.

    Am unable to proceed from here. Please help.

    Regards

    SNair007iN

  57. Doesn’t Windows 2008 come with a secure ftp solution out of the usage of IIS? Of course, I know it is suppose to be ftps and not sftp but it would provide a similar solution without the need for cygwin. Don’t get me wrong… I love the usage of cygwin. I use them on my on windows systems to allow me to connect to windows boxes with ssh here at home.

  58. Setting up SFTP on Windows 2008 (vmDK) http://bit.ly/bvp5BP

    This comment was originally posted onTwitter

  59. Setting up SFTP on Windows 2008 (vmDK) http://bit.ly/8YVLlp

    This comment was originally posted onTwitter

  60. {Blog Post} Setting up SFTP on Windows 2008 http://bit.ly/dw7IZn

    This comment was originally posted onTwitter

Trackbacks

  1. cant download gta v pc

    Setting up SFTP on Windows 2008 — DAMIAN KARLSON

Speak Your Mind

*