Confirm the installation on the first, you can use
The code is as follows |
Copy Code |
[root@localhost sv005-mongodb]# Service vsftpd restart Shutting down VSFTPD: [OK] Starting vsftpd for VSFTPD: [OK] or use the command [Root@localhost sv005-mongodb]# chkconfig--list vsftpd VSFTPD 0:off 1:off 2:off 3:off 4:off 5:off 6:off |
If not installed we need to install first:
The code is as follows |
Copy Code |
Yum Install vsftpd Then start vsftpd:/ETC/INIT.D/VSFTPD start vi/etc/vsftpd/vsftpd.conf modify these two items: Chroot_local_user=yes (to be added) Chroot_list_enable=no |
Then save it!
To create a user group:
Groupadd User Group
Useradd-g webusers-d/path user name
passwd user name to modify user's password.
Chown-r User name: User group/path/
Just because you modified the configuration file, remember to reboot: Service vsftpd restart
Ok! It worked!
To the top, if you need to add some virtual users, we can look down
VSFTPD Configure virtual users
FTP users are generally unable to log on to the system, which is also for security. In the system, users who do not have access to the system are generally referred to as virtual users; The virtual user is also to be written into the/etc/passwd; This is only a virtual user's approach, but it is not true that the virtual user, just put his login shell permissions removed, so he did not have the ability to login If we want to locate the Beinan user directory in the/opt/beinan directory and not login to the system, we should do the following.
The code is as follows |
Copy Code |
[Root@localhost ~]# adduser-d/opt/beinan-g ftp-s/sbin/nologin [Root@localhost ~]# passwd Beinan Changing password for user Beinan. New Password: Retype new Password: Passwd:all authentication tokens updated successfully. [Root@localhost ~]#
|
In fact, this is not enough, but also to change the configuration file vsftpd.conf to ensure that local virtual users have access to read and write;
Local_enable=yes
Write_enable=yes
local_umask=022
How do I implement a virtual path?
Like what:
The code is as follows |
Copy Code |
/home/a Map to ftp://localhost/a /HOME/B/C is the FTP://LOCALHOST/C
|
This can be done in the following ways.
[Root@localhost ~]# Mount–bind [Original directory] [new catalog]
For example, my FTP default directory is/var/ftp, I want to put the/mnt/ling/winsoft folder, map to the/var/ftp directory, I have the following operation
We need to build a directory in the/VAR/FTP directory first.
The code is as follows |
Copy Code |
[Root@localhost ~]# Mkdir/var/ftp/winsoft And then execute the Mount command. [Root@localhost ~]# Mount–bind/mnt/ling/winsoft/var/ftp/winsoft
|
That's OK.
Turn on the Linux VSFTPDV server log function
Turn the # number on the front of the xferlog_file, which means that the Vsftp log is turned on so we can view Vsftpd.log in the/var/log directory. This is the VSFTP log function, which is extremely important for us. Xferlog_file=/var/log/vsftpd.log How do I get the VSFTP server to limit the number of links and the maximum number of links per IP? Should change the Linux vsftpd server configuration file vsftpd.conf, add the following two lines:
max_clients= Digital
max_per_ip= Digital
For example: I would like to have my vsftp maximum support link number of 100, each IP, can support up to 5 links, so I should add the following two lines in vsftpd.conf:
max_clients=100
Max_per_ip=5
How do I limit the speed of transmission?
Anon_max_rate= Digital
Note: This is the speed of anonymity
Local_max_rate= Digital
Note: This is the speed of the local user on the VSFTP server
Note: The unit of this number is byte, so we have to calculate it.
For example, I want anonymous users and vsftp users to download 80KB, so this number should be 1024x80=81920
So we're going to add the following two lines to the vsftpd.conf.
anon_max_rate=81920
local_max_rate=81920
Here are some common commands:
A tool or command that manages a user group (group);
Groupadd Note: Add user group;
Groupdel Note: delete user group;
Groupmod Note: Modify user group information
Groups Note: Displays the user group to which the user belongs
User Management commands
Useradd Note: Add user
Userdel Note: Delete user
AddUser Note: Add user
passwd Note: Set password for user
Usermod Note: Modify the user command, you can modify the login by Usermod, user's home directory and so on;