If you need to upload files to your NVMe VPS you have a couple of options. You can use a program like WinSCP to connect over SSH and upload files. This can be time-consuming. Or you can install FTP to your instance. In this guide, we will go through the whole process of installing FTP and also how to configure FTP so you can upload files and folders. You should have an Ubuntu or Debian-based system already installed. You can install this from the discovery control panel.
First, install vsftpd on your instance with the following commands.
apt install vsftpd
Now you have your FTP server installed it’s time to configure its settings. But there are a number of security issues you will want to take into account. In our configuration, we are locking FTP users to specific directories and disabling SSH access for these users.
So, the configuration settings are stored in the /etc/vsftpd.conf file. Open that file and let’s start configuring FTP.
In this file, change the following statements;
anonymous_enable=NO local_enable=YES # Enable uploads write_enable=YES # To stop users browing files outside of their directory. Read the # chroot_local_user section below for more information. chroot_local_user=YES # Set Passive Ports. Remember to open in any firewalls. pasv_enable=YES pasv_min_port=32000 pasv_max_port=35000 # Create and Enable Access List. Usernames must be placed in the userlist # file userlist_enable=YES userlist_file=/etc/vsftpd.user_list userlist_deny=NO
This option stops users from browsing outside of their home directory. When you enable this option you cannot upload files to the home directory because it is writeable. To resolve this you have two options.
- Specifically specify the user’s upload directory. The below statement would allow uploads to the /home/user directory
- Specify the allow-writeable-chroot directive. This is the default. Should be used in addition to the above.
Finally, restart the FTP service.
systemctl restart vsftpd
After installing FTP and going through the configuration you need to enable FTP access in your firewall. If you are using UFW the commands are below. If you are using our network firewall, just add the ports in your client area.
ufw allow 20:21/tcp ufw allow 32000:35000/tcp ufw disable ufw enable
That’s the process complete. You should now be able to FTP to your instance and upload files and folders. But if you wanted to, you could also configure an SSL to secure connections over FTP. That’s outside the bounds of this guide but a quick search on google should produce a lot of results.
How was this article?
You might also like
More from All About Linux
How to install a Cloudflare Origin SSL Certificate – NGINX
An SSL Certificate is vital to encrypt data between you and your clients. SSLs can be complicated things. If they …
How To Open Port FirewallD and Close Port FirewallD -CentOS 7
Open And Close Ports In FirewallD - Manage Zones In FirewallD Like IPtables, FirewallD is a Linux firewall that filters packets …
How To Add Bootsplash Image To Your OS Template
Instead of the default black screen. When creating an OS template you can choose to add a bootsplash image to …