G33K-TRICKS: How to Setup SFTP server for Free

Thursday, October 18, 2018

How to Setup SFTP server for Free



What exactly SFTP is? And how to Setup SFTP Server


SFTP (SSH File Transfer Protocol) is a secure file transfer protocol and it runs over the SSH and comes with all auth and security that ssh supports. Now-a-days FTP or FTPS is getting replaced by SSH as FTP is considered as not so secure.

The SFTP protocol runs over the SSH protocol as a scheme and it was designed by Tatou Ylonen.
setup SFTP ServerSpecial thing about SFTP is , there are no ports exposed.

SFTP VS. FTPS

People usually wish to check SFTP vs. FTPS. FTPS is essentially the previous ftp protocol run over SSL (Secure Sockets Layer) or TLS (Transport Layer Security).

Benefits of FTP over SFTP includes,
FTPS is essentially FTP, which implies it's code mode, which might corrupt files if the mode isn't properly set and SFTP runs over SSH within the normal SSH port. Thus, no extra ports have to be compelled to be opened on the server and no extra authentication must be maintained. This simplifies configuration and reduces the probability of config errors.
FTPS wants sophisticated firewall configuration and might not work NAT. Ports 989 and 990 have to be compelled to be open. 
FTPS needs an additional server software system package to be put in and patched, whereas SFTP comes with SSH.
What's more, FTPS supports each active and passive modes , that additional complicates firewall configurations and is susceptible to issues.
FTPS can't be used as a File system. 


Here are easy steps to setup Free SFTP server

To setup the Free SFTP server you can download the Rebex Tiny SFTP server
from https://labs.rebex.net/tiny-sftp-server
And surprisingly, it is free for Commericial and Non-commercial purpose.
Once download is finished, unzip the zipped file and run the "RebexTinySftpServer.exe" file.
There would be another file named "RebexTinySftpServer.exe.config" file which is a server configuration file with below config settings available by default.
The configuration is straight-forward , key-value pair and easy to understand.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<!-- user and root dir -->
<add key="userName" value="sftpuser"/>    
<add key="userPassword" value="sftpuser"/>
<add key="userRootDir" value="data"/>

<!-- user public keys for public key authentication (optional) -->
<add key="userPublicKeyDir" value=""/>

<!-- misc config -->
<add key="showUserDetailsOnStartup" value="true"/>

<!-- security -->
<add key="rsaPrivateKeyFile" value="server-private-key-rsa.ppk"/>
<add key="rsaPrivateKeyPassword" value="my-super-secure-password"/>

<add key="dssPrivateKeyFile" value="server-private-key-dss.ppk"/>
<add key="dssPrivateKeyPassword" value="my-super-secure-password"/>

<!-- port -->
<add key="sshPort" value="22"/>

<!-- start server when application is started? -->
<add key="autoStart" value="false"/>
</appSettings>

</configuration>

As SSH works on port 22 so config also has the same.
For further security , you can create RSA and DSA keys (.ppk) and provide the password in config which was used while creating the keys.
If you are not comfortable in creating the SSH keys, you can you this awesome free tool that runs on Windows called "PuttyGen" (a utility for RSA and DSA key generation )

Link to download : https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html

If you are working with any SFTP client and you are just looking for test connection with SFTP Server, you dont need to host one. Rebex has already provided a dummy sftp running server at
test.rebex.net  Use demo as username and password as password



Please Note: REBEX SFTP server store the password in clear text as you can see from the config file.
Do let me know if you have any other SFTP server that can be easily setup.
Incoming search: Rebex sftp firewall issues


3 comments:

Karthick Raj said...

Amazing information from this blog really very very useful. Get huge discounts on latest mobile phones.

Latest Mobile Phones

Ali said...

Nice Article, Keep it up!
Get Daily Tech News, Free Guides, Tips & Tricks & Softwares => What is Global Better Ads Standards?

Epson adjustment Program said...
This comment has been removed by a blog administrator.