1. See if VSFTP is installed
[[Email protected] ~] #rpm-qa|grep vsftpd
If vsftpd-2.2.2-13.el6_6.1.x86_64 appears, the VSFTP is already installed.
If no fields such as vsftpd appear, perform the second step;
2. Installing VSFTPD
[[Email protected] ~] # yum-y Install vsftpd
3. Configure the vsftpd.conf file "/etc/vsftpd/vsftpd.conf"
#Example config file/etc/vsftpd/vsftpd.conf##The default compiled in Settings is fairly paranoid. This sample file#loosens things up a bit, to make the FTP daemon more usable.#Please see VSFTPD.CONF.5 for all compiled in defaults.##READ This:this Example file is a exhaustive list of vsftpd options.#Please read the VSFTPD.CONF.5 manual page to get a full idea of vsftpd ' s#capabilities.##Allow anonymous FTP? (beware-allowed by default if you comment this out). #anonymous_enable=yes ##Uncomment this to allow Local users to log in.local_enable=YES##uncomment this to enable any form of FTP write command.write_enable=YES##Default umask for Local Users is 077. wish to 022,#If your users expect that (022 was used by the most other ftpd ' s)local_umask=022##Uncomment the anonymous FTP user to upload files. this only#effect if the above global write enable is activated. Also, you'll#obviously need to create a directory writable by the FTP user.#Anon_upload_enable=yes##Uncomment this if you want the anonymous FTP user to being able to create#new directories.#Anon_mkdir_write_enable=yes##Activate directory messages-messages given to remote users when they#go into a certain directory.dirmessage_enable=YES##The target log file can be Vsftpd_log_file or xferlog_file.#This depends on setting Xferlog_std_format parameterxferlog_enable=YES##Make sure port transfer connections originate from port (ftp-data).connect_from_port_20=YES##If you want, you can arrange for uploaded anonymous files to being owned by#a different user. note! Using "root" for uploaded files are not#recommended!#Chown_uploads=yes#Chown_username=whoever##The name of the log file when Xferlog_enable=yes and Xferlog_std_format=yes#warning-changing this filename affects/etc/logrotate.d/vsftpd.log#Xferlog_file=/var/log/xferlog##switches between logging into Vsftpd_log_file and xferlog_file files.#NO writes to Vsftpd_log_file, YES to Xferlog_filexferlog_std_format=YES##You could change the default value of timing out of an idle session.idle_session_timeout=600##The default value for timing out a data connection.data_connection_timeout=120##It is recommended this define on your system a unique user which the#FTP server can use as a totally isolated and unprivileged user.#nopriv_user=ftpsecure##Enable this and the server would recognise asynchronous ABOR requests. not#Recommended for security (the code is non-trivial). Not enabling it,#However, may confuse older FTP clients.#Async_abor_enable=yes##By default the server would pretend to allow ASCII mode but in fact ignore#The request. Turn on the below options to has the server actually do ASCII#mangling on files while in ASCII mode.#beware, some FTP servers, ASCII support allows a denial of service#Attack (DoS) via the command "Size/big/file" in ASCII mode. VSFTPD#predicted this attack and have always been safe, reporting the size of the#raw file.#ASCII mangling is a horrible feature of the protocol.ascii_upload_enable=yesascii_download_enable=YES ##fully customise the login banner string:ftpd_banner=welcome to Blah FTP service.##You may specify a file of disallowed anonymous e-mail addresses. Apparently#useful for combatting certain DoS attacks.#Deny_email_enable=yes#(default follows)#banned_email_file=/etc/vsftpd/banned_emails##Specify an explicit list of the Local users to Chroot () to their home#directory. If Chroot_local_user is YES and then this list becomes a list of#users to Not chroot ().chroot_local_user=YES #Chroot_list_enable=yes#(default follows)#chroot_list_file=/etc/vsftpd/chroot_list##You may activate the "-r" option to the builtin LS. this was disabled by#default to avoid remote users being able to cause excessive I/O on large#sites. However, some broken FTP clients such as "ncftp" and "mirror" assume#The presence of the "-r" option, so there was a strong case for enabling it.ls_recurse_enable=YES##When "Listen" directive are enabled, VSFTPD runs in standalone mode and#listens on IPV4 sockets. This directive cannot is used in conjunction#With the listen_ipv6 directive.listen=YES##This directive enables listening on IPV6 sockets. To listen on IPv4 and IPv6#sockets, you must run the copies of vsftpd with the configuration files.#Make sure, which one of the listen options is commented !#Listen_ipv6=yesPam_service_name=vsftpduserlist_enable=yestcp_wrappers=YESuserlist_deny =nolocal_root=/var/www/html/ftpuse_localtime=yes
4. New FTP Account
[[Email protected] ~] # useradd cookie-s/sbin/nologin [[Email protected] ~] # passwd Cookies
5. Edit the User_list file, allow new account access to FTP "can also delete the original account, and then add the FTP account allowed to access"
# vsftpd userlist # # # do not even prompt for a password. # Note that the default Vsftpd Pam config also checks/etc/vsftpd/ftpusers # for users, that is denied. rootbindaemonadmlpsyncshutdownhalt mail newsuucpoperatorgamesnobodycookie
6. Create a new FTP access root directory and set access permissions "directory name has been noted in vsftpd.conf, if the FTP can upload files, you need to change the permissions to 777"
[[Email protected] ~] # mkdir/var/www/html/ftp [[Email protected] ~] # chown-r cookie/var/www/html/ftp [[Email protected] ~] #
7. Turn on VSFTPD service
[[Email protected] ~] # Service vsftpd Start
8. Start the FTP service on boot
var] # chkconfig vsftpd on
Installing VSFTPD server under Centos 6.5