Instructions: Setting up and Synchronising an FTP Server

FTPbox

We have already introduced you to the FTPbox solution. Now we will show you how to set up your own (S)FTP server and then use it to synchronise with FTPbox (as of 24 February 2023).

For this tutorial, we assume that you already have an established SSH connection. This will be the case for almost any web server you can access from a terminal. For our Raspberry Pi (see tutorial) , this is already the case. If you want to access your files from anywhere, you should use dynamic DNS to set up a globally valid host, as described in the Raspberry Pi tutorial.

Note: SFTP is different from regular FTP. Instead of using the FTP protocol, it runs over an encrypted shell connection. As FTPbox also works with SFTP, and it will probably be easier for you to set up, we will use this standard in this tutorial.

1. Set up users

First we create a new user with a home directory. This is where we will put the files later. Run the following command in the console of your server (e.g. Raspberry Pi):

sudo adduser ftp

You will now be asked for a password, which you can create yourself. Enter it again. If you are asked for your name or other information, just press [Enter] several times to cancel the request.

Now open the SSH configuration file in vi or another editor.

sudo vi /etc/ssh/sshd_config

Scroll down using the arrow keys. Press [Insert] to switch to edit mode. Now you can press [Enter] to insert two blank lines, then type the following code:

Match User ftp ChrootDirectory /home/ftp ForceCommand internal-sftp

This will restrict the user's rights a little. Press [Esc] and type ":wq" to save the changes and close the file.

The changes will take effect when the SSH service is restarted:

sudo service ssh restart

To lock the SFTP user to a directory, execute the following command chain:

sudo chown root /home/ftp && sudo chmod go-w /home/ftp && sudo mkdir -m ug+rwX /home/ftp/dateien && sudo chown ftp:ftp /home/ftp/dateien

2. Increase security

Next, install a package that logs incorrect login attempts and blocks IPs for a certain time if necessary:

sudo apt-get install fail2ban

3. Using FTPbox

Select the version suitable for your system in the downloads. Select the version that is compatible with your system. FTPBox only supports devices with Windows operating systems.

Once you have downloaded the file, you can install it. When the installation is complete, run the configuration program.

As part of the setup, you will also need to adjust the FTP settings.

Select 'SFTP' and 'Normal'. For 'Host', enter either your local IP address or, if already set up, your host at the dynamic DNS service example.dyndns.com. Note that in the latter case, you will need to enable port 22 on your router.

Select "ftp" as the user name and enter the password you set earlier.

You will then be asked to select a synchronisation folder on your PC. Select a folder with the files you want to synchronise with the FTP server.

Then specify the folder on the server. Select the "Files" folder.

You are now ready to start. Initially, all files in the synchronisation folder on your computer will be uploaded. As soon as you make any changes, they will also be immediately transferred via FTP.

The FTPbox is now ready for your system.

Cloud Server

Cloud server

Learn more about the highly available public SIM-Cloud

Learn more

4. Access via mobile device

You can easily access your FTP server from a smartphone to view or download files. This is possible with any FTP client, regardless of the FTPBox solution.

You can choose the one that suits you best in terms of look and function. Depending on how your server is set up, you should make sure that the application supports SFTP. This is usually the case.

5. Done!

Your folder is now synchronised with one or more PCs and you can access your files from your tablet or smartphone. Your own FTP server with FTPbox makes the cloud alternative possible.

Most importantly, you can also use a simple web host with web space. However, it should support either SFTP or FTPS so that you can transfer files to your cloud in encrypted form.

Was this article helpful?

Did you like the article?

Cookie consent

By clicking «I agree», you consent to our website's use of cookies to give you the most relevant experience by remembering your preferences and repeat visits. However, you may visit «Manage сookies» to provide controlled consent. Learn more

Cookies settings

functional

Necessary cookies are crucial for the basic functions of the website and the website will not work in its intended way without them.

Analytics

Analytical cookies are used to understand how visitors interact with the website.

Advertisement

Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns.