How to create FTP user account on ubuntu

If you are going to install an FTP server on Ubuntu, you can choose the simplicity of vsftpd .

FTP stands for File Transfer Protocol. It is similar to HTTP (HyperText Transfer Protocol), in that it specifies a language for transferring data over a network. FTP is unencrypted by default, so by itself, it is not a good choice for secure transmission of data.

This guide will help you install and configure an FTP server (vsftpd ) on Ubuntu 18.04.

Prerequisites

  • Access to a user account with sudo privileges
  • Access to a terminal window/command line (Ctrl-Alt-T)
  • The apt package manager, included by default

Step 1: Update System Packages

Start by updating your repositories – enter the below commnad in a terminal window:

sudo apt-get update

Step 2: Backup Configuration Files

Before making any changes, make sure to back up your configuration files.

1. Create a backup copy of the default configuration file by entering the following:

sudo cp /etc/vsftpd.conf  /etc/vsftpd.conf_default

This command creates a copy of the default configuration file.

2. Create a new vsftpd configuration file /etc/vsftpd.conf using your preferred text editor:

$ sudo nano /etc/vsftpd.conf

Step 3: Install vsftpd Server on Ubuntu

A common open-source FTP utility used in Ubuntu is vsftpd. It is recommended for its ease of use.

1. To install vsftpd, enter the command:

sudo apt install vsftpd

2. To launch the service and enable it at startup:

sudo systemctl start vsftpd

sudo systemctl enable vsftpd

Step 4: Create FTP User

Create a new FTP user with the following commands:

sudo useradd –m testuser

sudo password testuser

The system should ask you to create a password for the new testuser account. Create a sample file in the new user’s home account:

sudo mkdir /home/testuser

Step 5: Configure Firewall to Allow FTP Traffic

If you are using UFW that comes standard with Ubuntu, it will block FTP traffic by default. Enter the following commands to open Ports 20 and 21 for FTP traffic:

sudo ufw allow 20/tcp

sudo ufw allow 21/tcp

Note: If you are using a different firewall, refer to the instructions to allow access on Port 20 and Port 21. These are the listening ports for the FTP service.


Step 6: Connect to Ubuntu FTP Server

Connect to the FTP server with the following command:

sudo ftp ubuntu-ftp

Replace ubuntu-ftp with the name of your system (taken from the command line).

Log in using the testuser account and password you just set. You should now be successfully logged in to your FTP server.

Configuring and Securing Ubuntu vsftpd Server

Change Default Directory

By default, the FTP server uses the /srv/ftp directory as the default directory. You can change this by creating a new directory and changing the FTP user home directory.

To change the FTP home directory, enter the following:

sudo mkdir /srv/ftp/new_location

sudo usermod –d /srv/ftp/new_location ftp

Restart the vsftpd service to apply the changes:

sudo systemctl restart vsftpd.service

Now, you can put any files you want to share via FTP into the /srv/ftp folder (if you left it as the default), or the /srv/ftp/new_location/ directory (if you changed it).

Authenticate FTP Users

If you want to let authenticated users upload files, edit the vsftpd.conf file by entering the following:

sudo nano /etc/vsftpd.conf

Find the entry labeled write_enable=NO, and change the value to “YES.”

Write_Enable option in vsftpd.config file.

Save the file, exit, then restart the FTP service with the following:

sudo systemctl restart vsftpd.service

This allows the user to make changes inside their home directory.

Securing FTP

Limit User Access

Numerous exploits take advantage of unsecured FTP servers. In response, there are several configuration options in vsftpd.conf that can help secure your FTP server.

One method is to limit users to their home directory. Open vsftpd.conf in an editor and uncomment the following command:

chroot_local_user=YES

This is an example of the file in nano:

Command to limit users to their home directory.

Create a User List File

To create a list file, edit /etc/vsftpd.chroot_list, and add one user per line.

Instruct your FTP server to limit this list of users to their own home directories by editing vsftpd.conf:

chroot_local_user=YES

chroot_list_file=/etc/vsftpd.chroot_list

The image ilustrates the edits that were made:

Chroot list to limit user access.


Restart the vsftpd service:

sudo systemctl restart vsftpd.service

By default, the list of blocked users from FTP access is stored in /etc/ftpusers. To add blocked users, edit this file and add one user per line.

Encrypt Traffic With FTPS

Another method to secure your FTP server is to encrypt the traffic. This is done by using FTPS – File Transfer Protocol over SSL (Secure Socket Layer).

For this to work, users need to be set up with a shell account on the FTP server. This will add a layer of secure encryption to your FTP traffic. To set up FTPS, open your vsftpd.conf file in an editor, and add the following lines:

ssl_enable=YES

rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem

rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key

The file shoullook like this:

Enable SSl for vsftpd on Ubuntu.

Restart the service to apply the changes:

sudo systemctl restart vsftpd.service

Thank you for reading this article.

Was this helpful?

8 / 6

Leave a Reply 57

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


gQuryZNwDSnRmUV

gQuryZNwDSnRmUV

It worked! Thank you.

satınAL

satınAL

My programmer is trying to convince me to move to .net from PHP.

I have always disliked the idea because of the expenses.

Your help greatly appreciated!

Read More

Read More

I’m extremely impressed with your writing skills as well as with the layout on your weblog. Is this a paid theme or did you customize it yourself? Anyway keep up the excellent quality writing, it’s rare to see a great blog like this one nowadays.

OEyUSYuGNhj

OEyUSYuGNhj

Thanks for sharing your thoughts. I truly appreciate your efforts and I am waiting for your further write ups thanks once again.

pçi satın al

pçi satın al

Pretty section of content. I just stumbled upon your website and in accession capital to assert that I acquire in fact enjoyed account your blog posts.
Any way I’ll be subscribing to your feeds and even I achievement you
access consistently rapidly.

Natalie

Natalie

It’s an amazing post in favor of all the online people; they
will get benefit from it I am sure.

Nilda

Nilda

Very nice, I’m new to the blog
world but I’m trying to get started and set up my own.
Any help would be greatly appreciated!

YEKSIoGfRjxdZ

YEKSIoGfRjxdZ

Very nice,
Your help is greatly appreciated!

Ezequiel

Ezequiel

Hello everyone, it’s my first pay a visit at this site, and post is
actually fruitful for me, keep up posting such articles.

begummiefor

begummiefor

Im obliged for the blog article.Much thanks again. Want more.

Donna

Donna

My brother suggested I might like this web site. He was totally right.
This post actually made my day. You can not imagine just how much time
I had spent for this info! Thanks!

Liam

Liam

I’ve learn several good stuff here. Definitely price bookmarking for
revisiting. I wonder how a lot attempt you set to create any such great informative site.

Skye

Skye

Just desire to say your article is as amazing. The clarity in your
post is simply nice and i could assume you’re an expert on this
subject. Well with your permission allow me to grab your
RSS feed to keep updated with forthcoming post. Thanks a million and please keep up the gratifying work.

Elyse

Elyse

Hi there friends, its enormous paragraph about education and fully explained, keep it up all the time.

Delphia

Delphia

Hi colleagues, its wonderful article about teaching and entirely defined, keep it up all
the time.

Adrianna

Adrianna

This post will assist the internet users for creating new blog or even a weblog from start to end.

viagra

viagra

Keep up the great writing.

Maynard

Maynard

It’s very straightforward to find out any matter on web as compared to books, as I found this paragraph
at this web site.

Elba

Elba

This paragraph gives clear idea designed for the new users of
blogging, that in fact how to do blogging and site-building.

pamehe

pamehe

Hi just wanted to give you a quick heads up and let you know a few of the
images aren’t loading correctly. I’m not sure why but
I think its a linking issue. I’ve tried it in two different
browsers and both show the same outcome.

whegam

whegam

If you are going for most excellent contents like I do,
only pay a quick visit this web page everyday because it offers quality
contents, thanks

pshy

pshy

Good day! This is my first visit to your blog! We are a team of volunteers and starting a new project in a
community in the same niche. Your blog provided us beneficial information to work on. You have done a
outstanding job!

Milo

Milo

Hey! This is my first comment here so I just wanted to give a quick shout out and say I truly enjoy reading
your posts. Can you suggest any other blogs/websites/forums that cover the same topics?

Thanks a lot!

Leslie

Leslie

Everything is very open with a very clear description of the issues.
It was really informative. Your site is useful.
Thank you for sharing!

zovre lioptor

zovre lioptor

Some genuinely nice and utilitarian info on this site, likewise I think the design and style contains wonderful features.

Lula

Lula

Hello! Do you know if they make any plugins to help with SEO?
I’m trying to get my blog to rank for some targeted keywords but I’m not seeing very good success.
If you know of any please share. Thank you!

Dalene

Dalene

Actually no matter if someone doesn’t be aware of after that its up to other visitors
that they will assist, so here it occurs.

Tayla

Tayla

We are a bunch of volunteers and opening a new scheme in our
community. Your website provided us with useful info to work on. You have performed a formidable activity and our whole
neighborhood will likely be grateful to you.

Larryamugh

Larryamugh

click through the this website

Lucio

Lucio

Pretty! This was a really wonderful article.
Thanks for providing this info.

Elva

Elva

Hi, its good piece of writing about media print, we all understand media is a enormous source of data.

Keisha

Keisha

It’s a shame you don’t have a donate button! I’d without
a doubt donate to this brilliant blog! I guess for now i’ll settle for book-marking and adding your RSS feed to my Google account.
I look forward to new updates and will share this
website with my Facebook group. Chat soon!

Kandi

Kandi

Hi there just wanted to give you a quick heads up.
The words in your post seem to be running off the screen in Firefox.
I’m not sure if this is a format issue or something to do with internet
browser compatibility but I figured I’d post to let you
know. The design and style look great though! Hope you get the
issue fixed soon. Thanks

Kristina

Kristina

Hello are using WordPress for your blog platform?
I’m new to the blog world but I’m trying to get started and create
my own. Do you require any html coding knowledge to make your own blog?
Any help would be greatly appreciated!

Nate

Nate

Have you ever considered about including a little
bit more than just your articles? I mean, what you say is important and all.

However just imagine if you added some great visuals or videos to give your posts more, “pop”!
Your content is excellent but with images and video
clips, this website could undeniably be one of the best in its niche.
Terrific blog!

Angelo

Angelo

Thanks for finally talking about How to create FTP user account on ubuntu, Loved it!

zortilo nrel

zortilo nrel

Great work! This is the type of info that should be shared around the web. Shame on the search engines for not positioning this post higher! Come on over and visit my website . Thanks =)

Renee

Renee

This post provides clear idea designed for the new viewers of blogging, that really how to do blogging.

Alvaro

Alvaro

You really make it seem so easy along with your presentation but I to find this matter to be
actually something which I think I’d never understand. It kind of
feels too complex and very wide for me. I am looking forward
for your subsequent submit, I’ll try to get the dangle of it!

Tommy

Tommy

Thanks for some other informative web site. The place else may I get that
kind of information written in such a perfect means?

I have a project that I’m just now operating on, and I have been at
the glance out for such information.

Dorthy

Dorthy

I am very interested.

Karolyn

Karolyn

Hmm it seems like your website ate my first comment
(it was super long) so I guess I’ll just sum it up what
I submitted and say, I’m thoroughly enjoying your blog.
I too am an aspiring blog blogger but I’m still new to everything.
Do you have any recommendations for novice blog writers?

I’d genuinely appreciate it.

someo

someo

Say, you got a nice blog article.Really thank you!

Agen338

Agen338

Wow, great blog post.Much thanks again. Will read on…

katalirm

katalirm

Wow, superb blog layout! How long have you been blogging for?
you made blogging look easy. The overall look of your
website is fantastic, as well as the content!

autapprlist

autapprlist

Awesome! Its really remarkable piece of writing, I have got much clear idea about from this article.

Albertina

Albertina

Hello There. I found your blog using msn. This is a really well written article.
I will be sure to bookmark it and return to read more of your useful information. Thanks for the post.

I will certainly return.

Denniskab

Denniskab

I value the blog article. Really Great.

Marilyn

Marilyn

Hello i am kavin, its my first occasion to commenting anywhere, when i read this article i thought
i could also make comment due to this good article.

ailhostin

ailhostin

Thanks for any other wonderful article. Where else may just anyone get that type of information in such an ideal approach of writing.

Tarotading

Tarotading

Hello there! Would you mind if I share your blog with my zynga group? There’s a lot of folks that I think would really appreciate your content. Please let me know. Cheers

buhost cart

buhost cart

essay helpers – essays help research papers writing

treme gebruiken

treme gebruiken

woah this blog is great i love reading your posts. Keep up the good work! You know, a lot of people are searching around for this information, you could help them greatly.

betiflix

betiflix

Thanks again for the blog post.Thanks Again.

Fildena

Fildena

Really informative blog.Much thanks again. Keep writing.

Mathura

Mathura

Really enjoyed this article post.Thanks Again.

etransaxle

etransaxle

This is one awesome blog post.So much thanks again. Really Great.