• Contact
  • Contact Us
  • Disclamer
  • Home 1
  • Home 2
  • Home 3
  • Privacy Policy
Monday, May 26, 2025
How VPS - How to use/setup VPS
  • Login
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
How VPS - How to use/setup VPS
No Result
View All Result
Home VPS/Servers management guides

How To Set up a VSFTPD Server on an Ubuntu 16.04 VPS or Dedicated Server

How VPS by How VPS
February 6, 2020
in VPS/Servers management guides
0
How To Set up a VSFTPD Server on an Ubuntu
0
SHARES
45
VIEWS
Share on FacebookShare on Twitter

How To Set up a VSFTPD Server on an Ubuntu

Contents

  1. How To Set up a VSFTPD Server on an Ubuntu
    1. Brief Description
  2. Step 1: Installation
  3. Step 2: Configuration
    1. Step 3: Configure Uncomplicated Firewall (UFW)
    2. Step 4: Add FTP User
    3. Step 5: Conduct FTP Login Test

Brief Description

FTP data is usually insecure since information (usernames, passwords, data) is transmitted unencrypted in clear-text. It’s very IMPORTANT to encrypt the FTP connections to Linux FTP Servers using VSFTPD (SSL/TLS).

This short tutorial is highly important for Intermediate Level System Administrators and Users who usually transfer highly confidential data (documents, images, e.t.c) to their company’s or organization’s Linux FTP servers.

Special note: consult HowVPS‘s  Best Linux hosting services page to find the leading web hosts in this category, including expert and user reviews.

Step 1: Installation

Install vsftpd and openssl packages on the Ubuntu 16.04 Linux server

$ sudo apt-get install vsftpd openssl

How To Set up a VSFTPD Server on an Ubuntu 16.04 VPS or Dedicated Server

Generate a self-signed certificate to secure the FTP server connections.

$ sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 –keyout /etc/ssl/private/vsftpd.key -out /etc/ssl/private/vsftpd.pem

How To Set up a VSFTPD Server on an Ubuntu 16.04 VPS or Dedicated Server

Step 2: Configuration

Edit the configuration file /etc/vsftpd.conf

$ sudo cp /etc/vsftpd.conf /etc/vsftpd.conf.bak
$ sudo vim /etc/vsftpd.conf

Ensure configurations as shown below:

How To Set up a VSFTPD Server on an Ubuntu 16.04 VPS or Dedicated Server

How To Set up a VSFTPD Server on an Ubuntu 16.04 VPS or Dedicated Server

# Allow anonymous FTP? (Disabled by default).

anonymous_enable=NO

#

# Uncomment this to allow local users to log in.

local_enable=YES

#

# Uncomment this to enable any form of FTP write command.

write_enable=YES

 

# This option specifies the location of the RSA certificate to use for SSL

# encrypted connections.

rsa_cert_file=/etc/ssl/private/vsftpd.pem

rsa_private_key_file=/etc/ssl/private/vsftpd.key

ssl_enable=YES

#DO NOT allow anonymous users to use SSL

allow_anon_ssl=NO

#Force local users to use SSL

force_local_data_ssl=YES

force_local_logins_ssl=YES

#Enable latest SSL and TLS version 1 and disable old versions

ssl_tlsv1=YES

ssl_sslv2=NO

ssl_sslv3=NO

#Enter username in local_root directory to enable this config to work for ftp users added in future

user_sub_token=$USER

#Path to share and send files from

local_root=/srv/ftp/$USER

#Users in the vsftpd_userlist are the ONLY ones allowed for FTP access

userlist_enable=YES

userlist_file=/etc/vsftpd_userlist

userlist_deny=NO

 

Start vsftpd service

$ sudo systemctl start vsftpd
$ sudo systemctl status vsftpd

Step 3: Configure Uncomplicated Firewall (UFW)

Enable vsftpd connections via ufw

$ sudo ufw status

How To Set up a VSFTPD Server on an Ubuntu 16.04 VPS or Dedicated Server

Special Note: By-default, ufw is usually installed in Ubuntu, however if for some reasons it’s not there you can install using

$ sudo apt-get install ufw

Ensure the firewall allows FTP connections

$ sudo ufw allow 20/tcp
$ sudo ufw allow 21/tcp
$ sudo ufw status

How To Set up a VSFTPD Server on an Ubuntu 16.04 VPS or Dedicated Server

Special Note: Vsftpd also uses ssh port i.e. 22 so ensure ufw allows for ssh connections

Step 4: Add FTP User

Switch to root user and enter root password

$ su –

As root, create user that’s allowed to login into mark’s ftp directory

# adduser --home /srv/ftp/mark mark

-d Set /srv/ftp/mark as the home directory for ftpuser

How To Set up a VSFTPD Server on an Ubuntu 16.04 VPS or Dedicated Server

Set the ftp root directory to be owned by ftpuser

# chown –R mark /srv/ftp/mark

Switch back from root user

# su - linuxuser

Include mark in /etc/vsftpd_userlist to be allowed ftp access

# sudo vim /etc/vsftpd_userlist

Then enter “mark” to the file.

Start the VSFTPD service

$ sudo systemctl restart vsftpd

Confirm VSFTPD service is running

$ sudo systemctl status vsftpd

How To Set up a VSFTPD Server on an Ubuntu 16.04 VPS or Dedicated Server

Step 5: Conduct FTP Login Test

Login from a Linux Local Machine

$ ftp -p ubuntu16-hostadvice

If you try to login the default way without SSL, it will fail to login and produce an error as shown below:

How To Set up a VSFTPD Server on an Ubuntu 16.04 VPS or Dedicated Server

Now try accessing using SSL i.e SFTP (Secure FTP) Protocol as shown below:

$ sftp mark@ubuntu16-hostadvice

How To Set up a VSFTPD Server on an Ubuntu 16.04 VPS or Dedicated Server

Note the successful connection.

Special Note: Please note this will work ONLY IF either of the following are done:

  1. Password Authentication is enabled in /etc/ssh/sshd_config/

  2. If Password Authentication is disabled and only SSH Keys Private Authentication is enabled, you have to configure ssh keys private key authentication for that specific ftp user with the Linux Server.

Previous Post

Bluehost Review

Next Post

How To Install Hugo On Ubuntu 18.04

Next Post
How To Install Hugo On Ubuntu

How To Install Hugo On Ubuntu 18.04

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

No Result
View All Result

Recent Post

Install Imagemagick on CentOS
CentOS

Install Imagemagick on CentOS

by How VPS
June 28, 2023
0

This is how I installed Imagemagick on a vanilla CentOS server Start off by installing the prerequisites yum install php-pear...

Read more
how to Check phpinfo

How to Check phpinfo of Hosting or VPS?

June 28, 2023
Failed to download metadata for repo 'appstream' on Centos 8

How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

February 25, 2022
How to Fix MySQL Error "Plugin 'InnoDB' registration as a STORAGE ENGINE failed"?

How to Fix MySQL Error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed”?

November 17, 2020
How to optimize Mysql or MariaDB

How to optimize Mysql or MariaDB

November 3, 2020

Recent News

  • Install Imagemagick on CentOS
  • How to Check phpinfo of Hosting or VPS?
  • How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

Category

  • Arch
  • Authentication
  • Backups
  • BSD
  • Centmin Mod
  • CentOS
  • Control Panels
  • CoreOS
  • CWP
  • Debian
  • Directadmin
  • Encryption
  • Fedora
  • Firewalls
  • Hocvps Script
  • Hosting providers
  • Kloxo-MR
  • Linux
  • Mitigations
  • Operating System
  • Plesk
  • Reviews
  • Securing VPS/Servers
  • Security Patches
  • SSL Certificates
  • Uncategorized
  • Upgrading
  • VPS/Servers management guides
  • Vulnerability Detection
  • Web servers software
  • Webhosting Control Panel
  • About
  • Advertise
  • Careers
  • Contact

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
Thabet