How to turn a Mac OS X, Linux, or Windows machine into an SFTP server

Create your own SFTP server -- the easy way

How to setup an SFTP server
Credit: Atlasowa

What is SFTP? How does it differ from FTP?

FTP (File Transport Protocol) was first invented in 1971 and was originally used to transfer files over NCP (Network Control Protocol), later versions were upgraded to support TCP/IP -- commonly used today -- and to support IPv6 Internet addresses.

Like FTP, SFTP (Secure File Transport Protocol) is used for file transfer, but its technological underpinnings are more secure. SFTP implements the SSH (Secure Shell) protocol, which means that unlike FTP, login credentials and data are not sent in the clear -- unencrypted back-and-forth between server and client. This also means SFTP is incompatible with FTP.

If one were to turn a machine into a file server, SFTP appears to be more desirable than FTP. So, I've provided instructions below on how to quickly turn a machine running your OS of choice into an SFTP server.

Turn Mac OS X machine into an SFTP server

On OS X Mavericks, open System Preferences, then select Sharing. Click the Remote Login checkbox then choose the users that are allowed access.

sftp server mac osx sshd

At this point the SFTP server should be running. When testing the server from a different machine, connect to the IP address shown in the Sharing window. I used a Slackware Linux VM to verify that my Mac's SFTP server was running properly:

Testing sftp server

Turn Linux machine into an SFTP server

Many, if not most, Linux distributions can be set to start SSH automatically. Linux -- like Mac OS X -- by extension usually permits the machine to be used as an SFTP server if sshd is running. To be positive, you can check to ensure that the Subsystem sftp line does not begin with a comment character (#) in the sshd_config file.

In Slackware, a quick way to do this is to type the following command: more /etc/ssh/sshd_config | grep "Subsystem"

sftp server linux sshd config grep pico

Mine appeared to be commented, so I edited the sshd_config file using pico. And, after removing the comment character and saving, I restarted sshd using these commands: /etc/rc.d/rc.sshd stop
/etc/rc.d/rc.sshd start

sftp server linux sshd stop start

Turn Windows machine into an SFTP server

To quickly get an SFTP server running on Windows, I recommend the msftpsrvr utility, free to download courtesy of the nice folks at CoreFTP.

sftp server windows link

To use, simply run the downloaded executable file. Enter the login credentials you wish your SFTP users to use, and the path of a folder you wish to use as the SFTP server root. Once started, the app waits for incoming connections, presenting the IP address of each SFTP user connected.

sftp server windows mini sftp server

On a related note, if you also happen to need SFTP client software for Windows, I recommend WinSCP or CoreFTP's tools.

Enjoy

So regardless of which OS you use, enjoy the convenience of serving piping-hot, fresh files -- quick and secure -- from the comfort of your very own SFTP server.

This article is published as part of the IDG Contributor Network. Want to Join?

ITWorld DealPost: The best in tech deals and discounts.
Shop Tech Products at Amazon