VSFTPd service configuration.
Part of the r_pufky.srv collection.
Read through defaults and arch documentation before proceeding. VSFTPd is very powerful but easily mis-configured. Role requires configuration for deployment.
Setup FTP server allowing test_local_user
local user login. test_local_user
is managed outside of this role.
vsftpd_config_write_enable: true
vsftpd_config_chroot_local_user: true
vsftpd_config_allow_writeable_chroot: true
vsftpd_config_chroot_list_enable: true
vsftpd_config_chroot_list:
- 'test_local_user'
vsftpd_config_ls_recurse_enable: true
vsftpd_service_harden_enable: true
- name: 'FTP local users'
hosts: '*'
become: true
roles:
- 'r_pufky.srv.vsftpd'
Setup FTP server allowing virtual user logins backed by the local ftp
user
account. Virtual user configuration is automatically managed, see defaults.
host_vars/vsftpd.example.com/vars/vsftpd.yml
vsftpd_user_home_mode: '0550'
vsftpd_service_virtual_users:
- user: 'test'
pass: '{{ vault_test }}'
- user: 'test2'
pass: '{{ vault_test2 }}'
vsftpd_config_anonymous_enable: false
vsftpd_config_local_enable: true
vsftpd_config_write_enable: true
vsftpd_config_chroot_local_user: true
vsftpd_config_guest_enable: true
vsftpd_config_guest_username: 'ftp'
vsftpd_config_virtual_use_local_privs: true
vsftpd_service_harden_enable: true
- name: 'FTP local users'
hosts: '*'
become: true
roles:
- 'r_pufky.srv.vsftpd'
If service fails to start with status=2/INVALIDARGUMENT
; the configuration
file is syntactically correct but has conflicting settings. This is an end user
configuration issue.
Manually execute the configuration file to determine the exact cause:
vsftpd /etc/vsftpd.conf
Chroot environments require read-only root directories; otherwise logins result in:
500 OOPS: vsftpd: refusing to run with writable root inside chroot ()
Check your configuration and set the backing user home directory read-only.
See vsftpd_service_local_root_mode
, vsftpd_service_anon_root_mode
, and
vsftpd_user_home_mode
. Ensure vsftpd_service_local_root_recursive_enable
,
vsftpd_service_anon_root_recursive_enable
are not plowing directory
permissions.
Typically 0550
permissions resolve.
Reference:
Configure environment
Run all unit tests:
molecule test --all
Create a bug and provide as much information as possible.
Associate pull requests with a submitted bug.
AGPL-3.0 License (direct link)
PGP Fingerprint: 466EEC2B67516C7117C85CE3A0BC35D16698BAB9 | github gist