file transfer service
Main configuration file directory /etc/vsftpd/vsftpd.conf
First install the ftp server
yum install vsftpd
The default directory for storing files /var/ftp/pub
Anonymous login
create a file
Start the service and turn off the firewall
Browser access ftp://IP address
can download but not upload
Remember to modify the pub directory permissions
Also pay attention to changing the security value. The default security value does not work.
Add read and write permissions to security values
chcon -t public_content_rw_t pub
Modify boolean value
getsebool -a|grep ftp finds the boolean value associated with ftp
setsebool ftpd_anon_write on
restart the service
But you can look up
but cannot delete
Add parameter anon_other_write_enable=YES to delete anonymous users
Local user authentication login
anonymous_enable=NO
Cancel all restrictions related to anonymous users
new user haha
change haha password
cd /home/haha
New file touch 12345
set boolean again
getsebool -a|grep ftp
setsebool ftp_home_dir on
Modify haha permissions
restart the service
chroot_list_enable=YES Whether to restrict system users to their own home directory
chroot_list_file=/etc/vsftpd/chroot_list
Create a new directory /etc/vsftpd/chroot_list to add users who need to be locked
Note the security value of this file
allow_writeable_chroot=YES locks the local user in the current directory (it is useless without it)
FTP related permission settings
vim /etc/vsftpd/vsftpd.conf
anonymous_enable=YES Whether to allow anonymous ftp (default is YES), if otherwise select NO, access based on username and password
Use local_enable to allow local users to log in
write_enable whether to allow writing
local_umask local user upload permission mask
add anon_umask=022
anon_upload_enable=YES Whether to allow anonymous ftp users to upload (not supported by default)
anon_mkdir_write_enable whether to allow writing to the directory
chroot_list_enable=YES Whether to restrict system users to their own home directory
ftpd_banner=Welcome to blah FTP service.? Customize welcome message
connect_from_port_20=YES Whether to make sure the port transfer is from 20 (ftp-data)
xferlog_file=/var/log/vsftpd.log? The path and name of the ftp transfer log is /var/log/vsftpd.log by default
xferlog_std_format=YES? Use standard ftp xferlog mode?
idle_session_timeout=600 Set the default time to disconnect inactive sessions?
data_connection_timeout=120 Set data transmission timeout?
ascii_upload_enable=YES Whether to use ascii code to upload files
ascii_download_enable=YES Whether to use ascii code to download files?
userlist_enable=YES List users in the /etc/vsftpd/user_list file that cannot access the FTP server?
tcp_wrappers=YES Whether to support tcp_wrappers