Installing vsftpd (ftp server) on clear linux

install:

sudo swupd bundle-add make c-basic devpkg-libcap
curl https://security.appspot.com/downloads/vsftpd-3.0.5.tar.gz | tar xz
cd vsftpd-3.0.5
sudo mkdir -p /usr/local/bin /usr/local/man/man8 /usr/local/man/man5
make
sudo make install
sudo mkdir /usr/share/empty/
sudo mkdir /var/ftp/
sudo useradd -d /var/ftp ftp
sudo chown root:root /var/ftp
sudo chmod og-w /var/ftp
sudo cp vsftpd.conf /etc
sudo chown root:root /etc/vsftpd.conf

default directory for anonymous users will be /var/ftp/

how to use and configure:

man vsftpd
man vsftpd.conf

run:

sudo vsftpd

uninstall:

sudo rm -r /usr/local/bin/vsftpd /usr/local/share/man/man8/vsftpd.8 /usr/local/share/man/man5/vsftpd.conf.5 /etc/vsftpd.conf /usr/share/empty/
sudo userdel -fr ftp

intall explained:

# install build dependencies
sudo swupd bundle-add make c-basic devpkg-libcap    

# download and extract
curl https://security.appspot.com/downloads/vsftpd-3.0.5.tar.gz | tar xz    

cd vsftpd-3.0.5      # go into download directory
make                 # build
sudo make install    # install 

sudo mkdir /usr/share/empty/   # secure_chroot_dir (see man vsftpd.conf)
sudo mkdir /var/ftp/           # directory for anonymous ftp users
sudo useradd -d /var/ftp ftp   # user for anonymous ftp users

# optional:
sudo chown root:root /var/ftp  # change owner to root
sudo chmod og-w /var/ftp       # remove write permissions from all but owner

sudo cp vsftpd.conf /etc       # install sample config file

# the sample vsftpd.conf file is owned by the current user.
# if that user is non-root the user cant run vsftpd
# unless run_as_launching_user=YES
# and root wont be able to run vsftpd with the config file
# either, as running user must own the config file.
# to fix:
sudo chown root:root /etc/vsftpd.conf

Thanks for sharing! :+1: