User Tools

Site Tools


servers:vsftpd

Information

  • vsftpd 1)

Prerequisites

Dependencies

sudo apt install 'vsftpd'

Firewall

  • See ufw for more information
sudo ufw allow 20,21,990/tcp && sudo ufw allow 10090:10100/tcp

Service

sudo systemctl enable 'vsftpd' --now

Settings

General

  • For local_root, even though nas1 is used more frequently, Kodi clients are configured to start from the actual ftp root in order to go into the nas2 folder for media
  • To make nas1 convenient, set the root folder from FileZilla
sudo -e '/etc/vsftpd.conf' && sudo systemctl restart 'vsftpd'
# Custom
write_enable=YES
utf8_filesystem=YES
force_dot_files=YES
pasv_enable=YES
pasv_max_port=10100
pasv_min_port=10090
local_root=/srv/ftp

Encryption Support

Generate Certs

  • Country: US
  • State: PA
  • Locality: Charleroi
  • Org Name: Realm of Espionage
  • Org Unit: NAS
  • YOUR Name: x
  • Email: x
sudo openssl req -x509 -nodes -days 730 -newkey rsa:2048 -keyout '/etc/ssl/certs/vsftpd.pem' -out '/etc/ssl/certs/vsftpd.pem' && sudo chmod '600' '/etc/ssl/certs/vsftpd.pem'

Enable Encryption

  • :!: ssl_ciphers can be set to HIGH or any supported OpenSSL cipher, but the higher the cipher, the higher the performance hit 2)
sudo -e '/etc/vsftpd/vsftpd.conf' && sudo systemctl restart 'vsftpd'
ssl_enable=YES
allow_anon_ssl=NO
force_local_data_ssl=YES
force_local_logins_ssl=YES
require_ssl_reuse=YES

ssl_ciphers=AES128-SHA
ssl_tlsv1=YES
ssl_sslv2=NO
ssl_sslv3=NO

rsa_cert_file=/etc/ssl/certs/vsftpd.pem
rsa_private_key_file=/etc/ssl/certs/vsftpd.pem

fstab

PARTUUID

  • :!: Be sure to get the PARTUUID towards the end of the line, and not UUID
sudo blkid

fstab

  • :!: Change the x in PARTLABEL=
  • :!: This expects 1 drive each with a XFS partition
sudo mkdir -p '/srv/ftp/nas1' '/srv/ftp/nas2' && sudo -e '/etc/fstab'
# NAS
PARTUUID=x /srv/ftp/nas1 xfs defaults 0 2
PARTUUID=x /srv/ftp/nas2 xfs defaults 0 2
sudo mount --all

Permissions

chown

sudo chown --recursive 'espionage724':'espionage724' '/srv/ftp/nas1' && sync
sudo chown --recursive 'espionage724':'espionage724' '/srv/ftp/nas2' && sync

chmod

sudo chmod --recursive '774' '/srv/ftp/nas1' && sync
sudo chmod --recursive '774' '/srv/ftp/nas2' && sync
2)
specifically on Oak with a Phenom II X4, HIGH caps around 60-70MB/s, whereas AES128-SHA is 70-80MB/s, and no encryption is 100-110MB/s
servers/vsftpd.txt · Last modified: 2021/10/30 10:17 by Sean Rhone