15

How to configure FTP server in my Ubuntu 12.04 or 13.04.What to install and how to configure.

Braiam
  • 66,947
  • 30
  • 177
  • 264
Abhilash Goud
  • 153
  • 1
  • 1
  • 5
  • I'm not allowed to comment yet... so I post here regarding the previous comment. Beware of: local_umask=022 It should be: local_umask=0022 `022` **needs** a leading `0` to be interpreted as an octal number (instead of decimal), which is the idea of the mask. Otherwise you will suffer trying to understand why those weird permissions are being set in the files you upload... for example, 022(decimal) is actually 0026(octal). – maganap Apr 11 '14 at 12:56

2 Answers2

20

To install an FTP server, try out vsftpd. To install, just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command(s) below:

sudo apt-get install vsftpd

Once installed, you need to edit the config file

sudo gedit /etc/vsftpd.conf

Make sure that you change the items shown in the image below.

enter image description here

Once done, do

sudo service vsftpd restart

For more info and documentation, visit vsftpd and FTP Server Guide on Ubuntu

GunJack
  • 361
  • 2
  • 5
  • 19
Mitch
  • 106,657
  • 24
  • 210
  • 268
  • You might want to change your umask setting while your at it. `local_umask 022` Otherwise your files will get uploaded with 600 permissions. – TecBrat Feb 13 '14 at 19:01
0
  1. Fedora, RedHat, SUSE distros:

    dnf -y vsftpd 
    
  2. Ubuntu, Debian-based distros:

    sudo apt-get install vsftpd 
    
  3. ArchLinux-based distros:

    sudo pacman -S vsftpd 
    

That wasn’t so tough. Now on to configuring the FTP server. Mostly the configuration is in /etc/vsftpd.conf, with lots of documentation already in the config file.

For more info, run:

man vsftpd.conf 

Here are a few things you might want to update in the config file:

write_enable=YES #if you want people to be able to upload to the server 
local_enable=YES #allows users in /etc/passwd to login with their linux username/password 
anonymous_enable=YES #Allows anonymous login 
no_anon_password=YES #No password required for anonymous login 
anon_max_rate=30000 #Max transfer rate for anonymous client in Byte/sec 
anon_root=/example/directory #Directory that anonymous users will see. 
 
# Chroot Jail config 
chroot_list_enable=YES #prevents users from leaving the ftp dir 
chroor_list_file=/etc/vsftpd.chroot_list #specifies he file to which the users are contained. 

If you want to have only specific users able to log into the FTP server, add this to the config file:

userlist_enable=YES 
userlist_file=/etc/vsftpd.userlist #populate with allowed users 
userlist_deny=NO 

Now that you’ve configured your FTP server, time to restart to pick up the new config.

sudo systemctl restart vsftpd 

Also check this article: Install and configure FTP Server on Ubuntu 18

BeastOfCaerbannog
  • 12,964
  • 10
  • 49
  • 77