(1) Installation vsftp:
[[email protected] ~]$ sudo yum install vsftpd #sudo Add root privileges to normal users, log in with root user without sudo
(2) Complete the installation, configure the VSFTP:
VSFTP configuration file in:/etc/vsftpd/directory:
vsftpd.conf configuration files for//vsftp
User_list, ftpusers//Disable login vsftp user list
[[email protected] vsftpd]$ sudo vim /etc/vsftpd/vsftpd.conf #打开配置文件 # example config file /etc/vsftpd/vsftpd.conf## the default compiled in Settings are 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 not an 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=NO #是否允许匿名用户登录## 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. you may wish to change this to 022,# if your users expect that (022 is used by  MOST OTHER FTPD ' s) local_umask=022 #本地文件的文件掩码 ## uncomment this to allow the anonymous ftp user to upload Files. this only# has an effect if the above global write enable is activated. Also, you will# 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 be 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 #激活目录信息 When the user changes the directory, a message appears ## the target log file can be vsftpd_log_file or xferlog_file.# this depends on setting xferlog_std_format parameterxferlog_enable=yes # Enable the upload and download log function ## make sure port transfer connections originate from port 20 (Ftp-data).connect_from_port_20=yes #启动ftp数据连接端口请求 ## if you want, you can arrange for uploaded anonymous files to be owned by# a different user. Note! Using "Root" for uploaded files is not# recommended! #chown_uploads =yes#chown_username=whoever## the name of 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 may change thE default value for timing out an idle session. #idle_session_timeout = 600## you may change the default value for timing out a data connection. #data_connection_timeout =120 # Idle session Interrupt Time default is 2 minutes ## it is recommended that you 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 will 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 will pretend to allow ascii mode but in fact Ignore# the request. turn on the below options to have the server actually do ascii# mangling on files when in ascii mode.# Beware that on 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 has always been safe, reporting the size of the# raw file.# ascii mangling is a horrible feature of the protocol.# ascii_upload_enable=yes#ascii_download_enable=yes #是否允许使用ASCII格式来上传下载文件 ## you may fully customiSe the login banner string: #ftpd_banner =welcome to blah ftp service. #在ftp服务器中设置欢迎登陆 ## 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## you may specify an explicit list of local users to chroot () to their home# directory. if chroot_local_user is yes, 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 is 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 is a strong case For enabling it. #ls_recurse_enable =yes## when "Listen" directive is enabled , vsftpd runs in standalone mode and# listens on ipv4 Sockets. this directive cannot be 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 two copies of vsftpd with two configuration files.# make sure, that one of the listen options is commented !! #listen_ipv6 =yespam_service_name=vsftpd userlist_enable=yes // Whether users in the user list are allowed to log on to the FTP server, Tcp_wrappers=yes is not allowed by default
(3) Connect the FTP server:
In the Windows environment:
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/7F/A5/wKioL1cn-xGw5G_nAABYVjOptu4342.png "title=" Windows connection FTP "alt=" Wkiol1cn-xgw5g_naabyvjoptu4342.png "/>
In the Linux environment:
1. Connect to the FTP server:
Format: FTP [hostname| ip-address]a] in the Linux command line input: FTP 192.168.1.1b) server asks you user name and password, enter the user name and the corresponding password, respectively, to be certified.
2. Download the file
The download file usually uses the get and mget two commands.
a) Get
Format: Get [Remote-file] [Local-file]
Transfer files from the remote host to the local host.
To get/usr/your/1.htm on a remote server,
Get/usr/your/1.htm
b) mget
Format: mget [Remote-files]
Receives a batch of files from the remote host to the local host.
To get all the files under/usr/your/on the server,
ftp> cd/usr/yourftp> mget * *
3. Uploading Files
a) put
Format: Put Local-file [Remote-file]
Transfers a local file to the remote host.
If you want to transfer the local 1.htm to the remote host/usr/your, and renamed to 2.htm
Ftp> put 1.htm/usr/your/2.htm
b) mput
Format: Mput local-files
Transfers a batch of files from the local host to the remote host.
To upload all the HTML files in the local current directory to the server/usr/your/
ftp> cd/usr/your ftp> mput *.htm
4. Disconnect the connection
Ftp> bye
This article is from the "Creative Pilgrim" blog, so be sure to keep this source http://dearch.blog.51cto.com/10423918/1769580
Linux Installation configuration FTP server