CentOS 6.5 _ 64-bit system installation vsftp

Source: Internet
Author: User

CentOS 6.5 _ 64-bit system installation vsftp

VSFTP is a GPL-based FTP server software released on Unix-like systems. Its full name is Very Secure FTP, which can be seen from this name. The Compiler's original intention is code security.

The following describes how to install VSFTP in CentOS 6.5 _ 64-bit system.

1. view the linux system version and kernel information
[Root @ vmware1 ~] # Cat/etc/issue
CentOS release 6.5 (Final)
Kernel \ r on an \ m
[Root @ vmware1 ~] # Cat/etc/issue
CentOS release 6.5 (Final)
Kernel \ r on an \ m

2. Disable the firewall and selinux.

[Root @ vmware1 ~] #/Etc/init. d/iptables stop
[Root @ vmware1 ~] # Chkconfig iptables off
[Root @ vmware1 ~] # Setenforce 0

3. Install the vsftp package.
[Root @ vmware1 ~] # Yum install-y vsftpd

First, back up the default configuration file of vsftpd;
[Root @ vmware1 ~] # Cd/etc/vsftpd/
[Root @ vmware1 vsftpd] # cp vsftpd. conf vsftpd. conf. bak

4. Clear the default vsftpd. cong content.
Root @ vmware1 vsftpd] #> vsftpd. conf

5. The modified content is as follows:
[Root @ vmware1 vsftpd] # cat vsftpd. conf
Anonymous_enable = NO # logon by anonymous users is not allowed
Local_enable = YES # users in the vsftpd system can log on to vsftpd.
Write_enable = YES # Any FTP instruction that can be used to modify the File System
Local_umask = 002 # umask value for newly added files by anonymous users
Anon_upload_enable = NO # files cannot be uploaded by anonymous users
Anon_mkdir_write_enable = NO # files cannot be modified by anonymous users
Xferlog_enable = YES # enable a log file for recording upload and download in detail.
Use_localtime = YES # use local time instead of GMT
Vsftpd_log_file =/var/log/vsftpd. log # storage location of vsftpd logs
Dual_log_enable = YES # User Logon log
Connect_from_port_20 = YES # enable port 20
Xferlog_file =/var/log/xferlog # logs of uploaded and downloaded files
Xferlog_std_format = YES # standard format for logging
Idle_session_timeout = 600 # timeout value 60 seconds after login. If you do not perform any operation within one minute after login, the connection will be disconnected.
Chroot_local_user = YES # specifies whether the user in the user list file can be switched to the parent directory.
Listen = YES # enable listener
Pam_service_name = vsftpd. vu # Name of the verification file
Userlist_enable = YES # Allow users in the file specified by userlist_file to log on to the FTP server
Tcp_wrappers = YES # support for tcp_wrappers and restrict access (/etc/hosts. allow,/etc/hosts. deny)
Guest_enable = YES # starting with a virtual user
Guest_username = taokey # virtual user name
User_config_dir =/etc/vsftpd/vsftpuser # virtual user configuration file path
Pasv_min_port = 35000
Pasvanderbilt max_port = 45000
Pasv_enable = YES
Pasv_promiscuous = YES
Anon_other_write_enable = YES

6. Create a directory for ftp access, create a local ftp user, and set a password.
[Root @ vmware1 vsftpd] # mkdir/data/taokey-p
Create user taokey.
[Root @ vmware1 vsftpd] # useradd taokey
[Root @ vmware1 vsftpd] # passwd taokey password: 123.com
Change the password of your taokey.
New password:
Re-enter the new password:
Passwd: All authentication tokens have been successfully updated.
Set the taokey directory
[Root @ vmware1 vsftpd] # chown-R taokey. taokey/data/taokey
[Root @ vmware1 vsftpd] # ll/data/
Total usage 4
Drwxr-xr-x 2 taokey 4096 14:54 taokey

7. Install the db4 package and use it to generate database files later. Install the ftp client.
[Root @ vmware1 ~] # Yum install-y db4 *
[Root @ vmware1 vsftpd] # yum install-y ftp

8. Create an anonymous account.
[Root @ vmware1 ~] # Cd/etc/vsftpd
[Root @ vmware1 vsftpd] # echo "taokey"> vftpuser.txt
[Root @ vmware1 vsftpd] # echo "123.com"> vftpuser.txt
[Root @ vmware1 vsftpd] # cat vftpuser.txt
Taokey
123. com
[Root @ vmware1 vsftpd] # db_load-T-t hash-f vftpuser.txt vftpuser. db
[Root @ vmware1 vsftpd] # ll vftpuser. db
-Rw-r -- 1 root 12288 15:14 vftpuser. db

9. Add the verification information. In the/etc/pam. d directory, create a new vsftpd. vu file and write the following content.
[Root @ vmware1 vsftpd] # cat/etc/pam. d/vsftpd. vu
Auth required/lib64/security/pam_userdb.so db =/etc/vsftpd/vftpuser
Account required/lib64/security/pam_userdb.so db =/etc/vsftpd/vftpuser

10. Create a virtual user configuration file.
[Root @ vmware1 ~] # Cd/etc/vsftpd/
[Root @ vmware1 vsftpd] # mkdir vsftpuser
[Root @ vmware1 vsftpd] # cd vsftpuser/
[Root @ vmware1 vsftpuser] # touch taokey
[Root @ vmware1 vsftpuser] # cat taokey
Local_root =/data/taokey
Write_enable = YES
Anon_mkdir_write_enable = YES
Anon_world_readable_only = NO
Anon_upload_enable = YES
Anon_umask = 022
Anon_other_write_enable = YES

11. Restart vsftpd and check whether the port is enabled.
[Root @ vmware1 ~] # Service vsftpd restart
Disable vsftpd: [OK]
Start vsftpd For vsftpd: [OK]
[Root @ vmware1 ~] # Netstat-anpt | grep vsftpd
Tcp 0 0 0.0.0.0: 21 0.0.0.0: * LISTEN 2191/vsftpd

12. log on to the local ftp server for testing.
[Root @ vmware1 ~] # Ftp 127.0.0.1
Connected to 127.0.0.1 (127.0.0.1 ).
220 (vsFTPd 2.2.2)
Name (127.0.0.1: root): taokey
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
Ftp> dir
227 Entering Passive Mode (149,179, 0 ).
150 Here comes the directory listing.
226 Directory send OK.
Ftp> mkdir hello
257 "/hello" created
Ftp> dir
227 Entering Passive Mode (141,105, 0 ).
150 Here comes the directory listing.
Drwxr-xr-x 2 500 500 4096 Jan 16 hello
226 Directory send OK.

So far, VSFTP has been set up and the experiment has ended.

Four Advanced configurations of vsftpd Server:

VsFTPd configuration Tutorial:

Simple and practical Ubuntu FTP setup

Set up FTP server and Apache server on Ubuntu

Install the LAMP \ vsftpd \ Webmin \ phpMyAdmin service and settings in Ubuntu 13.04

Simple case of anonymous uploading of SeLinux and vsftpd on the RHEL6 Platform

Install vsftpd source code in Linux

Install and configure the FTP server vsftpd in openSUSE 13.2/13.1

This article permanently updates the link address:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.