Linux service configuration: basic configuration of Vsftp

Source: Internet
Author: User
Tags ssh server

Linux service configuration: basic configuration of Vsftp 15:16:10

Tags: original works of Vsftp Linux, which can be reproduced. During reprinting, you must mark the original source, author information, and statement in the form of a hyperlink. Otherwise, legal liability will be held. Http://zserver.blog.51cto.com/370152/157203

Startup: Pig is innocent. The main configuration file path is:/etc/vsftpd. conf. Some important parameters:
Anonymous_enable = yes/no whether anonymous users are allowed to access anon_upload_enable = yes/no whether anonymous users are allowed to upload files anon_mkdir_write_enable = yes/no whether anonymous users are allowed to create directories exist = yes/no anonymous users and whether the virtual user has the permission to delete local_enable = yes/no allow the local user to log on to write_enable = yes/no to set whether to globally write anon_root =/var specify the anonymous user directory chroot_local_user = yes the current directory chroot_list_enable = yes/no locks the users in the list to their own directory, use chroot_list_file =/etc/vsftpd/chroot_list to specify the chown_uploads = yes/no anonymous user upload owner. The specified function must be used with the next parameter. use chown_username = user name to specify the owner max_clients of the File Uploaded by anonymous users = 300 Max connections: 300anon_max_rate = 30000 speed limit for anonymous users and virtual users: 30 K/Slocal_max_rate = 30000 speed limit for local users: 30 K/ smax_per_ip = 10 maximum number of connections per IP listen_port = 22 change the listening port
The following describes the specific configuration to implement the following requirements: Anonymous Users are allowed to log on, the speed limit for anonymous users is 60 K/S, and only downloads are allowed. The listening port is 22 and the maximum number of connections is 10. The new user ftp1 has a speed limit of 200 K/S. You can upload, download, and delete the new folder. Go to the/etc/vsftpd directory, and open the main configuration file vsftpd. conf In the vi Editor: directly Add the following options:
Anon_max_rate = 60000
Anon_upload_enable = no
Anon_other_write_enable = no
Anon_mkdir_write_enable = no
Max_clients = 10
Local_max_rate = 200000
Restart the vsftp service:
[Root @ mongoadefedora vsftpd] # service vsftpd restart
Add the user ftp1 and set the logon script to/sbin/nologin:
[Root @ mongoadefedora vsftpd] # useradd ftp1-s/sbin/nologin
[Root @ LidadeFedora vsftpd] # passwd ftp1
The default vsftp directory is/var/ftp. To facilitate the test, create a new file named "testLocal" in/var/ftp ", create a new file in "/var/ftp/pub" and name it "testAnon ". Because the root user creates a file and the file owner is root, you need to set the permission of the file to 644 others so that the user can read the file and set the/var/ftp/pub permission to 777, indicates that all users have read and write permissions. because port 22 is occupied by the ssh server, you need to disable the ssh service and restart the vsftp service. Test with Flashfxp on the client: Create a site "VsftpTest", enter the IP address of the Vsftp server, enter port 22, set the user name to ftp1, enter the password you set, and then click "Connect: because local_root is not used, the local user's home directory is automatically redirected when logging on to the local user. chroot_local_user = yes is not used, so the local user can browse the files and folders that he has the permission to read in the entire file system: switch to the directory "/var/ftp/pub ", the permission for this directory is 777. upload a file of more than 10 MB and test the ftp1 upload speed: test the Folder creation and deletion permissions. Test anonymous user permissions: Select "anonymous" and connect: anonymous user logs in successfully: Enter the pub directory and try to delete the testAnon file, it indicates that anon_other_write_enable = no in the configuration file takes effect. The final permission is equivalent to the permission in the configuration file or the linux File System permission. For example, the vsftp configuration file allows anonymous users to download files, but this is not enough. The files or folders to be downloaded can be read by other users. An error occurred while trying to upload the file, meeting the requirement that anonymous users only allow downloading. Finally, test the download speed of anonymous users: This is the basic application of vsftp. Next time, write the advanced application of vsftp.

This article is from the blog "stupid pig server notes", please be sure to keep this source http://zserver.blog.51cto.com/370152/157203

 

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.