1 -- unmount view vsftpdrpm-qa | grepvsftpd in current server example result: vsftpd-2.2.2-13.el6_6.1.x86_64 executes unmount rpm-evsftpd-2.2.2-13.el6_6.1.x86_64 return: automatically back up vsftp user list file warning:/etc/vsftpd upon Unmount. confsav
1 -- Uninstall
View vsftpd on the current server
Rpm-qa | grep vsftpd
Example result: vsftpd-2.2.2-13.el6_6.1.x86_64
Run uninstall
Rpm e vsftpd-2.2.2-13.el6_6.1.x86_64
Back up vsftp user list files automatically when uninstalling
Warning:/etc/vsftpd. conf saved as/etc/vsftpd. conf. rpmsave
Warning:/etc/vsftpd/user_list saved as/etc/vsftpd/user_list.rpmsave
Delete the above files
Rm-rf/etc/vsftpd
Check whether vsftpd is still in startup
Chkconfig -- list
View vsftpd running status
Service vsftpd status
Return: vsftpd: unrecognized service (vsftpd cannot be identified, indicating vsftpd has been uninstalled)
2 -- installation
Yum-y install vsftpd
3 -- Configuration
The content of the main configuration file of vsftpd is as follows:
-----------------/Etc/vsftpd. conf START ---------------------------------------
Anonymous_enable = NO
Local_enable = YES
Write_enable = YES
Local_umask = 022
# Anon_upload_enable = YES
# Anon_mkdir_write_enable = YES
Dirmessage_enable = YES
Xferlog_enable = YES
Connect_from_port_20 = YES
# Chown_uploads = YES
# Chown_username = whoever
# Xferlog_file =/var/log/xferlog
Xferlog_std_format = YES
Idle_session_timeout = 600
Data _ connection_timeout = 120
# Nopriv_user = ft1_cure
# Async_abor_enable = YES
Ascii_upload_enable = YES
Ascii_download_enable = YES
Ftpd_banner = Welcome to lightnear FTP service.
# Deny_email_enable = YES
# Banned_email_file =/etc/vsftpd/banned_emails
Chroot_local_user = YES
# Chroot_list_enable = YES
# Chroot_list_file =/etc/vsftpd/chroot_list
Ls_recurse_enable = YES
Listen = YES
# Listen_ipv6 = YES
Pam_service_name = vsftpd
Userlist_enable = YES
Userlist_deny = NO
# Set the main directory accessible to FTP users (if this directory does not exist, you can create and modify permissions)
Local_root =/var/ftp
Tcp_wrappers = YES
Use_localtime = YES
---------------------/Etc/vsftpd. conf END ------------------------------------
Add an FTP account
Useradd ftpadmin-s/sbin/nologin
Set password for ftpadmin
Passwd ftpadmin
Enter the password twice.
Modify the/etc/vsftpd/user_list file
Clear all the content and add a user ftpadmin.
Create an FTP root directory
Mkdir/var/ftp
If the preceding directory already exists, you only need to modify the permission.
Chown-R ftpadmin/var/ftp
Chmod-R 755/var/ftp
Vsftpd service configuration is enabled by default.
Check whether the vsftpd service is in the startup item
Chkconfig -- list
If no
Chkconfig -- add vsftpd
Enable startup
Chkconfig -- level 35 vsftpd on
Review vsftpd restart item list
Chkconfig -- list
The result is as follows:
Vsftpd 0: off 1: off 2: off 3: on 4: off 5: on 6: off
At this point, the vsftpd service has been restarted after the installation and configuration is complete.
Service vsftpd restart
You can use FlashFXPE or FileZilla to log on to FTP.
I passed the test!