Example Configuration for FTP (vsftpd) with User Blocking in Home Directory.
Example configuration for FTP (vsftpd) with user blocking in home directory.
IInstalling FTP in Ubuntu:
sudo apt install vsftpd
This is simple.
Now, open the configuration file:
/etc/vsftpd.conf
Check that the parameters in this file were as follows:
listen=NO
listen_ipv6=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
dirmessage_enable=YES
use_localtime=YES
ftpd_banner=Welcome to My FTP service.
allow_writeable_chroot=YES
chroot_local_user=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list
pam_service_name=vsftpd
rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
ssl_enable=NO
Also, create a file
/etc/vsftpd.chroot_list
(if it does not exist)
and add to it user codes, for example:
1002
1003
User codes can be viewed in /etc/passwd
Restart the FTP service, and try to connect via FTP.
If your firewall is enabled, then you need to add rules for ports 20 and 22.
Now, the user will be blocked in their own home directory when entering via FTP.
Home directory of the user can be changed in /etc/passwd
Comments (0)
No comments yet.