| In this paper, a number of previous articles written on many occasions with their own installation and configuration experience, written in more detail, the article finally ftp command set with all the configuration properties vsftpd.conf comments. If the problem please reply to me, thanks!
1. Directly to the vsftpd site (ftp://vsftpd.beasts.org/users/cevans/) download the latest source package tar.gz format
2. # Extract $ tar-zxf vsftpd-xx.tar.gz
$ Cd. / Vsftpd-xx
# If the make install does not install the file, you may need to manually execute the following command
cp vsftpd / usr / local / sbin / vsftpd
cp vsftpd.conf.5 / usr/local/share/man/man5
cp vsftpd.8 / usr/local/share/man/man8
cd. / EXAMPLE / INTERNET_SITE
cp vsftpd.conf / etc
cp vsfpd.xinetd / etc / xinetd.d / vsftpd
/ Etc / rc.d / init.d / xinetd restart or service xinetd restart
###### Without xinetd service, the command $ yum install xinetd
3. To set up an independent startup mode, then in / etc / xinetd.d / vsftpd file to disable = no change YES
In / etc / vsftpd.conf file:
Add listen = yes This turned into a STANDALONE standalone mode
4. Anonymous login configuration:
Changes (if you do not modify the default is) anonymous_enable = YES
anon_root = / sunwill # anonymous login directory
anon_no_anon_password = YES # do not prompt for a password is prompted for a password NO other attributes, such as for the article last part of the configuration properties list (anonymous general with anon), he will need to add or modify
6. The local user first cp RedHat / vsftpd.pam / etc / pam.d / ftp (copy local user authentication pam file, not this step will not be able to use local user login!)
Modify or add:
local_enable = YES
write_enable = YES
local_umask = 022
local_root = / sunwill # local user is logged on the default directory, if not for local users which are logged the original default directory, can be used usermod to modify (usermod-d / dir user).
7. Virtual user configuration:
(1). Generate virtual user password database file. In order to establish the password database file, first generate a text file. The document follows the format of the singular behavior of the user name, and even acts Password:
# Vi account.txt
(2). Generate password database file, and modify its permissions:
db_load-T-t hash-f. / account.txt / etc / vsftpd / account.db
chmod 600 / etc / vsftpd / account.db
(To change the user delete account.db, then db_load)
If not db_load can copy from the CD the first few on the db4 rpm file to install (rpm-ivh *. rpm).
Command $ rpm-q db4 check
If it has loaded, then download the db4-java-4.3.29-9.fc6.i386.rpm,
db4-tcl-4.3.29-9.fc6.i386.rpm, db4-utils-4.3.29-9.fc6.i386.rpm three packages
Db4 is not installed if more than download the db4-4.3.29-9.fc6.i386.rpm, db4-devel-4.3.29-9.fc6.i386.rpm two packages. Use rpm-ivh *. rpm to install the downloaded package
(3). Create a virtual user's PAM file. Add the following two lines:
# Vi / etc / pam.d / vsftp.vu
auth required / lib / security / pam_userdb.so db = / etc / vsftpd / account
account required / lib / security / pam_userdb.so db = / etc / vsftpd / account
(4). Create a virtual user, set the user to access the directory, and set the virtual user access permissions:
useradd-d / ftpsite virtual_user
chmod 777 / ftpsite # # # allow all users to read and write operations through the steps of setting, / ftpsite is virtual_user user's home directory, the user is / ftpsite directory owners.
(5) in / etc / vsftpd.conf add
guest_enable = YES
guest_username = virtual_user
pam_service_name = vsftp.vu
(6), stop here already in use account.txt ftp account password
As for the change the permissions for each user be admitted to add vsftpd.conf
user_config_dir = user profile directory, such as user_config_dir = / etc / vsftpd /
First mkdir / etc / vsftpd
Then create the directory and user name the same name documents, such as $ vi / etc / vsftpd / gou
And add the permissions attributes, as follows:
write_enable = NO # can be written
anono_upload_enable = NO # can upload their own view of other properties can configure the properties increased.
(7) start the ftp, / etc / local / sbin / vsftpd &
(8) Linux ftp command to connect: ftp 192.168.18.107 # The following is the command input window information
Connected to 127.0.0.1.
220 (vsFTPd 2.0.5)
530 Please login with USER and PASS.
530 Please login with USER and PASS.
KERBEROS_V4 rejected as an authentication type
Name (127.0.0.1: root): gou
331 Please specify the password.
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
As shown, said a successful connection
8. Settings switched on (1) We will set it in front of an independent startup mode, to start running in the / etc / vsftpd.conf the listen = YES listen = NO or the comment to (2) # vi / etc / xinetd.d / vsftpd
Will disable = YES to disable = NO
(3) # service xinetd restart ftp 127.0.0.1 test available at this time
9. Ftp client commands
FTP command line format is:
ftp-v-d-i-n-g [host name], where
-V display all of the remote server response information;
-N limit ftp automatic login, which does not use;. N etrc documents;
-D Use debugging mode;
-G cancellation of global file names.
FTP uses an internal command is as follows (in brackets indicate optional):
<1>.! [Cmd [args]]: the local machine in the interactive shell, exit back to ftp the environment, such as:! Ls *. zip
<2>. $ Macro-ame [args]: implementation of the macro definition of macro-name.
<3>. Account [password]: after the success of the remote system to provide login access to system resources required to add a password.
<4>. Append local-file [remote-file]: Append a local file to the remote system host, if no file name specified remote system, use the local file name.
<5>. Ascii: ascii type transfer method to use.
<6>. Bell: After each command the computer beep once.
<7>. Bin: use binary file transfer mode.
<8>. Bye: exit the ftp session process.
<9>. Case: when using the mget, the remote host file name in uppercase to lowercase letters.
<10>. Cd remote-dir: enter the remote host directory.
<11>. Cdup: remote host directory into the parent directory.
<12>. Chmod mode file-name: the file-name remote host file access mode set to mode,
Such as: chmod 777 a.out.
<13>. Close: interrupt a session with the remote ftp server (and open correspondence).
<14>. Cr: transfer files using asscii way, it will be converted to carriage return line feed back line.
<15>. Delete remote-file: Delete the remote host file.
<16>. Debug [debug-value]: set the debug mode, showing each to send commands to the remote host, such as: deb up 3, if set to 0, said the cancellation of debug.
<17>. Dir [remote-dir] [local-file]: Display the remote host directory, and the results into a local file
<18>. Disconnection: the same close.
<19>. Form format: the file transfer mode is set to format, the default mode for the file.
<20>. Get remote-file [local-file]: the remote host's file remote-file transmitted to the local hard disk of the local-file.
<21>. Glob: Set mdelete, mget, mput file name extension, the default file name without extension, with the-g command line parameter.
<22>. Hash: 1024 bytes per transmission, display a hash sign (#).
<23>. Help [cmd]: show ftp command cmd inside the help information, such as: help get.
<24>. Idle [seconds]: remote server, set the sleep timer [seconds] seconds.
<25>. Image: set binary transfer mode (same binary).
<26>. Lcd [dir]: switch to the local working directory dir.
<27>. Ls [remote-dir] [local-file]: display the remote directory remote-dir, and into the local file local-file.
<28>. Macdef macro-name: define a macro, the next encounter macdef empty row, the end of the macro definition.
<29>. Mdelete [remote-file]: Remove the remote host file.
<30>. Mdir remote-files local-file: with dir like, but can specify multiple remote files,
Such as: mdir *. o. *. zipoutfile.
<31>. Mget remote-files: multiple remote file transfer.
<32>. Mkdir dir-name: in the remote host in the construction of a catalog.
<33>. Mls remote-file local-file: with nlist, but can specify multiple file names.
<34>. Mode [modename]: the file transfer mode is set to modename, the default mode for the stream.
<35>. Modtime file-name: display the remote host file was last modified.
<36>. Mput local-file: multiple file transfer to remote host.
<37>. Newer file-name: If the remote machine in the file-name modification time than the local hard disk the same name of the document is more recent, then retransmit the file.
<38>. Nlist [remote-dir] [local-file]: Display the remote host directory of the file list and into your local hard disk of the local-file.
<39>. Nmap [inpattern outpattern]: Set the file name mapping mechanism, makes the file transfer, file some of the characters in one another, such as: nmap $ 1. $ 2. $ 3 [$ 1, $ 2]. [$ 2, $ 3], then transfer files a1.a2.a3, the file name into a1, a2. The order applies to the remote host special non-UNIX machine situation.
<40>. Ntrans [inchars [outchars]]: set file name character translation mechanism, such as ntrans1R, the file name LLL will become RRR.
<41>. Open host [port]: specify the ftp server to establish connections, can be specified port.
<42>. Passive: to enter the passive transmission.
<43>. Prompt: set up multiple file transfer interaction when prompted.
<44>. Proxy ftp-cmd: in the secondary control connection, execute a ftp command, which allows to connect the two ftp servers to transfer files between two servers. The first ftp command must be open, to first establish a connection between the two servers.
<45>. Put local-file [remote-file]: the local file local-file sent to the remote host.
<46>. Pwd: display current working directory of the remote host.
<47>. Quit: with the bye, exit the ftp session.
<48>. Quote arg1, arg2 ...: verbatim the parameters sent to a remote ftp server, such as: quote syst.
<49>. Recv remote-file [local-file]: with the get.
<50>. Reget remote-file [local-file]: similar to get, but if local-file exists, the last transmission from the left off the resume.
<51>. Rhelp [cmd-name]: request access to the remote host for help.
<52>. Rstatus [file-name]: If you do not specify a file name, then display the status of the remote host, or display the file status.
<53>. Rename [from] [to]: change the file name of the remote host.
<54>. Reset: Clear answer queue.
<55>. Restart marker: marker Department from the specified symbol, to start get or put, such as: restart 130.
<56>. Rmdir dir-name: Remove the remote host directory.
<57>. Runique: Set the file name of only one store, if the file exists, then the original file with the suffix .1, .2 and so on.
<58>. Send local-file [remote-file]: with the put.
<59>. Sendport: set the PORT command.
<60>. Site arg1, arg2 ...: the parameters as the SITE command sent to the remote ftp host verbatim.
<61>. Size file-name: display the size of the remote hosts file, such as: site idle 7200.
<62>. Status: Displays the current status of ftp.
<63>. Struct [struct-name]: the file transfer structure is set to struct-name, the default use of stream structure.
<64>. Sunique: remote host file name is stored is set to only one (corresponding with the runique).
<65>. System: show the remote host's operating system type.
<66>. Tenex: the file transfer type to TENEX machines of the type required.
<67>. Tick: to set the byte transfer counter.
<68>. Trace: setting package tracking.
<69>. Type [type-name]: set file transfer type to type-name, default is ascii, such as: type binary, set the binary transfer mode.
<70>. Umask [newmask]: remote server's default umask is set to newmask, such as: umask 3
<71>. User user-name [password] [account]: remote host to identify themselves, need password, you must enter the password, such as: user anonymous my @ email.
<72>. Verbose: with the-v command line parameters that set the detailed reporting, ftp server, all responses will be displayed to the user, the default is on.
----------- Vsftpd. Conf configuration file attributes --------------
anonymous_enable = NO to disable anonymous user
no_anon_password = YES requires a password
anon_root = / var / ftp anonymous user's default home directory
local_enable = NO disables local user
local_root = webdisk local user's home directory (relative path is relative to the user's home directory, absolute path is that all users can log on to this directory, for example: / localftp)
guest_enable = NO Disable gust Users
ftp_username = ftp anonymous user name (default still anonymous use)
write_enable = YES local user can write
local_umask = 022 umask Upload file
file_open_mode = 0666 use of papers
anon_upload_enable = NO anonymous users can not upload
anon_mkdir_write_enable = NO anonymous users can not write to build directories
anon_other_write_enable = NO anonymous users can not do other write operations
anon_world_readable_only = YES anonymous users can read files
# Chown_uploads = YES modify the uploaded file owner
# Chown_username = ftpadmin modify the uploaded file owner for the XXX
ascii_upload_enable = NO does not use ascii upload files
ascii_download_enable = NO does not use ascii download
secure_chroot_dir = / usr / share / empty default values
idle_session_timeout = 600 600 seconds idle timeout
data_connection_timeout = 120 transmission timeout 120 seconds
accept_timeout = 60 pasv mode wait time 60 seconds
connect_timeout = 60 port mode wait time 60 seconds
xferlog_enable = YES start logging
xferlog_std_format = YES to use the standard log format
xferlog_file = / var / log / vsftpd.log log default location
pasv_enable = YES to enable passive mode
# Port_enable = YES to enable active mode
# Note here pasv and the port can only write one, not a YES, one NO, to let the other does not work, can only use # comment out, or be wrong.
features enable tcp_wrappers tcp_wrappers = YES
nopriv_user = nobody least privilege users
listen = YES to use standalone mode (recommended)
ftpd_banner = welcome to ftp. login welcome message
dirmessage_enable = YES when prompted to start the switch catalog features directory information
message_file =. message prompts the contents of the file directory
Setting file permissions
chroot_list_enable = YES start the user directory restriction feature
chroot_list_file = / etc / vsftpd / vsftpd.chroot_list this file to other users can not change the outer directory.
userlist_enable = YES start user limit function
userlist_deny = YES userlist file in the user log ban, NO, then only the user can log on userlist
userlist_file = / etc / vsftpd / vsftpd.user_list ban log file name and location of the user list (can be customized)
user_config_dir = / etc / vsftpd / userconf / special settings for individual user configuration files (in this directory to establish the corresponding "user" files, file write
write_enable = YES
anon_world_readable_only = NO
anon_upload_enable = YES
anon_mkdir_write_enable = YES
anon_other_write_enable = YES and other rights of information, this user will have here written permission)
max_clients = 100 maximum number of connections
max_per_ip = 5 the maximum number of connections per ip
connect_from_port_20 = YES to enable the port to transfer data 20
# Listen_address = 192.168.0.2 the ip address of the designated listener, if you have more than one ip, then
listen_port = 21 listening on port number
ftp_data_port = 20 data port
pasv_max_port = 40000 passive mode port number of the limit (0 is not limited to)
pasv_min_port = 30000 passive mode port number of the lower limit (0 for the Open)
Data transfer rate
anon_max_rate = 51200 anonymous users maximum transfer rate
local_max_rate = 5120000 maximum transmission rate of the local user