Jump to: navigation, search

Setup FTP server on Ubuntu Linux box

From w3cyberlearnings

You will learn how to setup the FTP server on Ubuntu box. I don't think it is matter for any version of Linux, you can apply it to other Linux box as well.

Contents

Install vsftpd

You gonna need a root or some type of privilege to install.

sudo apt-get install vsftpd

Find where is vsftpd installed

You need to find the location in case it is not installed on the default location.

root@sophal-desktop:~# whereis vsftpd
vsftpd: /usr/sbin/vsftpd /etc/vsftpd.conf /usr/share/man/man8/vsftpd.8.gz

After install

You need to modify a few section of the /etc/vsftpd.conf file. You can edit the vsftpd.conf by using VIM or any editor as you prefer. Within vsftpd.conf file provides detail information of the FTP server setting available. You need to read it the documentation before you make any changes. It is also considered security risk if you try to enable to many options. It's your own risk, and make sure you understand what you do. By default the FTP anonymous is allowed.

anonymous_enable=NO
local_enable=YES
write_enable=YES

Remove ipv6

You will get the following error 500 OOPS: run two copies of vsftpd for IPv4 and IPv6 on the /etc/vsftpd.conf. It means you need to disable the ipv6. You need to comment out the listen_ipv6.

#listen_ipv6=Yes

Restart vsftpd

service vsftpd start

How you check the status of vsftpd

You will get a list of all the vsftpd running. Yes, it is running!

root@sophal-desktop:~# ps aux | grep vsftpd
root      7862  0.0  0.0   2600  1256 pts/0    T    06:21   0:00 sudo service vsftpd start
root      8038  0.0  0.0   3640   948 ?        S    06:24   0:00 /usr/sbin/vsftpd
nobody    8097  0.0  0.0   3760  1044 ?        Ss   06:26   0:00 /usr/sbin/vsftpd
sophal    8099 13.2  0.0   3888  1032 ?        S    06:26   2:02 /usr/sbin/vsftpd
root      8325  0.0  0.2  19772  5548 pts/0    T    06:30   0:00 vim vsftpd.conf
root      8537  0.0  0.0   3004   764 pts/0    R+   06:41   0:00 grep vsftpd

Test Locally

root@sophal-desktop:/etc# ftp localhost
Connected to localhost.localdomain.
220 (vsFTPd 2.0.6)
Name (localhost:sophal): sophal
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> exit
421 Timeout.

Test From remote client

You can use any ftp client. You need the following:

  • user account from your ubuntu linux box
  • user password
  • IP address of your ubuntu linux box

Check who do not allow to login to FTP server

  • List all the users that are not allow to use FTP login
  • comment out those list and you will be able to let them login
  • NOT*** It can be security risk if you let root to login use FTP.
#cat /etc/ftpusers
# /etc/ftpusers: list of users disallowed FTP access. See ftpusers(5).
root
daemon
bin
sys
sync
games
man
lp
mail
news
uucp
nobody
Navigation
Web
SQL
MISC
References