Install and configure high availability VSFTP (finishing)

xiaoxiao2021-03-06  38

VSFTP installation

# 解 解 TAR-ZXF vsftpd-xx.tar.gzcd ./vsftpd-xx#vsftpd Need to use Nobody as a runner, userAdd NoBody

# # U / / 目 目 目 目 目 目 般 目 般般 般般 般般 般 / 般 / / m

# Compile Makemake Install # If Make Install does not have the file, you may need to manually perform the following command #cp vsftpd / usr / local / sbin / vsftpd

#cp vsftpd.conf.5 / usr / local / man / man5

#cp vsftpd.8 / usr / local / man / man8cd ./example/internet_sitecp vsftpd.conf / etcc/xinetd.d/vsftpdpd/etc/rc.d/init.d/xinetd Restart

VSFTPD I compiled it yourself. Many articles in the forum say that compilation is XINETD mode, so as long as in / etc / xinet

D. D / vSFTPD file, change disable = no to Yes! There is also a STANDALONE independent mode to add listen = yes in the /etc/vsftpd.conf file!

500 OOPS: COULD NOT BIND LISTENING IPv4 Socket Error:

Because Xinetd has already launched VSFTPD, and vsftpd is set to Stardalone mode, so stop xinetd service, service xinetd stop, then / usr / local / sbin / vsftpd & start FTP service

If it is started with a non-independent manner, rely on the Xinetd service started, the formulation is as follows:

// Profile

/etc/vsftpd/vsftpd.conf main configuration file

/etc/vsftpd.ftpusers Specify which users cannot access FTP servers

/etc/vsftpd.user_list The user specified in /etc/vsftpd/vsftpd.conf set UserList_enable = YES and can access the FTP server when UserList_Deny = NO

/ / Allow anonymous users to upload

Anon_upload_enable = YES allows anonymous users to upload

Anon_mkdir_write_enable = YES Opens anonymous user's write and creation of permissions

Anon_world_readable_only = no open anonymous user browsing permissions

IDLE_SESSION_TIMEOUT = 600 is interrupted after the user session is idle for 10 minutes

Data_connectiono_timeout = 120 is interrupted after the data connection is idle for 2 minutes

accept_timeout = 60

Connect_timeout = 60 automatically disconnects after idle 1 minute, and automatically activates after 1 minute

Max_clients = 200 total customer concurrent connection

Max_Per_IP = 3 Each client maximum connection

Local_max_rate = 50000

Anon_max_rate = 30000 Local User Maximum Transmission Rate 50kb / s, anonymous 30kb / s

//Safety

// Set /etc/hosts.deny

VSFTPD: Deny from ALL

// Set /etc/hosts.allow

VSFTPD: IP: Allow

// Create an anonymous upload directory

# MKDIR / VAR / FTP / InComing

#CHMOD O W / VAR / FTP / INCOMING /

// Run in xinetd mode

// Modify the configuration file

# vi /etc/vsftpd/vsftpd.conf// Add a comment before configuring the configuration option

// # listen = yes

/ / # TCP_WrapPers = YES

/ / Copy the Xinetd Profile from the document directory of VSFTPD

# cp /usr/share/doc/vsftpd-1.1.3/vsftpd.xinetd /etc/xinetd.d/vsftpd

// Modify the configuration file

# vi /etc/xinetd.d/vsftpd

// change disable = yes to disable = no

/ / Modify the file in RC3.D so that you do not start the running VSFTPD when starting.

# mv /etc/rc.d/rc3.d/s60vsftpd /etc/rc.d/rc3.d/s60vsftpd

/ / Restart the Xinetd daemon

Use the TAR package to install and configure high availability VSFTP

Author: Liangshang Feng screen name: Mr. Nice

Yesterday, I saw that there were friends who installed VSFTPs installed with a TAR package couldn't log in with local users and feel very surprised. But I have only done RPM.

So there is no say. Today, I successfully installed and configured a VSFTP on my machine. Now I put my process and

Let's talk, I hope to help everyone!

First, install [list: 1af834efb8] 1. Download the latest stable version vsftpd-1.2.1.tar.gz 2. Uninstall the original RPM vsftpd rpm -e vsftpd 3.tar xvzf vsftpd-1.2.1.tar.gz 4.CD vSFTPD-1.2.1 5.make 6.Useradd NoBody 7.mkdir / usr / share / empty 8.mkdir / var / ftp 9.UserAdd -d / var / ftp ftp 10.chown root.root / var / FTP 11.chmod OG-W / VAR / FTP

Description: If you have rpm vsftp like me, just uninstall, you can omit 6-11 step, if you don't have VSFT installed

p, please follow the class. 12.make install 13.vi /etc/xinetd.d/vsftpd changes disable = yes to NO, save exit. Then Service Xinetd Restart, OK! Newly installed VSFTP is already available

Make! Note: The default installed VSFTPD is started in XINETD. You need the above operation, after a while, let's talk about it.

Change to a stand-alone service. 14. FTP 127.0.0.1 Enter the username FTP, password is directly entering, OK! It is already connected! Enter Quit Exit. Then reftp 127.0.0.1

Enter the local user and password, but prompt Login Faild! Why? It turns out a local user-certified PAM file. 15.cp redhat / vsftpd.pam /etc/pam.dpp (note, without this step will not be able to use local users to log in!) 16.cp vsftpd.conf /etc/vsftpd.conf (now, default or only anonymous User Login) 17.vi /etc/vsftpd.conf Remove AnonMous_enable = YES to NO (Forbidden Anonymous Link, Unsafe) Remove Local_Enable = YES Note (Open Local User Connection Permissions) Put Write_enable = YES Note Remove (Open Local User's Write Permissions) Remove Service Xinetd Restart18 before LOCAL_UMASK = 022. Test FTP 127.0.0.1 again to log in with FTP User's empty password, will appear Login Faild Use local user login, OK! Has been successful! Upload file, ok! [/ list: u: 1AF834EFB8] Is this not finished? No, do a FTP, we usually need some special requirements: such as a user I only allow him to download, do not allow him to upload; another user can download or upload, but he can't delete files, can't give text

Part of the part; in addition, I also need my FTP to use unconventional ports, limit the speed of download, and need an admin user.

What should I do? Please see the part below!

Second, advanced configuration [list: 1af834efb8] 1. Use the standalone service A.vi /etc/xinetd.d/vsftpd to change disable = no to Yes, no longer need it! B. Vi /etc/vsftpd.conf plus listen = yes c.service xinetd restart d./r/local/sbin/vsftpd /etc/vsftpd.conf & ok! Now VSFTP is already a service that is started with independent! 2. Use unconventional port (2121) a.vi /etc/vsftpd.conf to add listen_port = 2121, save exit B.KILLALL -9 vsftpd c./r/local/sbin/vsftpd /etc/vsftpd.conf & Ok Now use FTP 127.0.0.1 will be prompted to be rejected (FTP: Connect: Connection Refues)! Then ftp

127.0.0.1 2121 Enter the username and password, OK! Can log in! 3. Implement different users Different privileges Now we will implement different permissions of three users: a.upload users, you can upload downloads, you can create a new folder, but not

Can delete files and folders, you cannot rename original files and folders; B.Download users can only download; C.Admin users

, Administrators, can be uploaded, can be downloaded, you can create a new folder, you can delete and change files and folder names. These users

You cannot log in to the system and lock it in your own catalog with FTP connections. A.cat < logins.txt> Upload> ******* #upload user password> Download> *******> admin> *********** ****>! Description, this text file format is: singular behavior user name, even behavior password B.DB_Load -t -t Hash -f logins.txt /etc/vsftpd_login.db C.chmod 600 / etc / vsftpd_login .db D.cd vSFTPD-1.2.1 / example; cp viryual_users / vsftpd.pam /etc/pam.d/ftp.vu (enter your unpacking source directory, copy the virtual user's authentication file to / ETC / Pam.d / Next) E.USERADD -D / home / ftpsite virtual; chmod 700 / home / ftpsite; su - virtual -c "echo

Hello> /homt/ftpsite/test.file (establish the FTP directory to be accessed by the virtual user and set up only Virtual users

Permissions and Create a file for download experiments) F.VI /etc/vsftpd.conf In this file, insert the following configuration statement guest_enable = yes (Enable virtual users) guest_username = virtual (map virtual users into local Virtual users) PAM_SERVICE_NAME = ftp.vu (specifying the PAM configuration file is ftp.vu) user_config_ d = / / etc / vsftpd_user_conf (Specify the storage path of different virtual user profiles) Save Exit G.MKDIR / ETC / VSFTPD_USER_CONF H. Open Different Users of Different Users Echo " Anon_World_Readable_only = no ">

/ etc / vsftpd_user_conf / download (open download permissions for Download users - only download; pay attention to this

Do not write YES, otherwise it will not list the files and directories) cp / etc / vsftpd_user_conf / download / etc / vsftpd_user_conf / upload vi / etc / vsftpd_user_conf / upload, add the following line write_enable = YES (increase write permission) anon_upload_enable = YES (increase Upload permissions) Anon_mkdir_write_enable = yes (Added Create Directory) CP / etc / vsftpd_user_inter_conf / etc / vsftpd_user_conf / admin / to add a line: Anno_other_writer_enable = YES (Add administrator user's delete / rename permission) i. Test KILLALL - 9 vSftpd; / usr / local / sbin / vsftpd /etc/vsftpd.conf & ftp 127.0.0.1 2121 Log in with user name Download and you set the password, LS, you can see file, download, success! Put a file, mention

Demay Permission Denied. Rename Test.file The same permissions are rejected; Delete Test.file is equally unsuccessful! Enter quit exit to log in with UPLOAD users, OK! You can upload, download, mkdir lsf, prompt "/ lsf" create; rename LSF LSF1 prompt Permission Denied, delete files are also unsuccessful! Enter quit exit, log in with the Admin user, you can have all the above permissions, then RMDir LSF, prompt Remove

Directory O [ERATION SUCCESSFUL; Delete Test.file Tips Delete Operation Successful! OK, Big

Completed! 4. There is also a speed limit, limit the number of connections of the same IP, limit the maximum number of connections, etc., I have written in another article, here is not

Take later! [/ list: u: 1af834efb8] 3, attached 1. My /etc/vsftpd.conf file content [quote: 1af834efb8] # example: 1af file /etc/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 MOSTHER FTPD'S) Local_umask = 022 ## UNComment THIS ALLOAD FTP User to Upload Files. This Only # HAS An Effect If The Above Global Write Enable IS Activated. Also, Y ou will # obviously need to create a directory writable by the FTP user.anon_upload_enable = NO ## Uncomment this if you want the anonymous FTP user to be able to create # new directories.anon_mkdir_write_enable = NO ## Activate directory messages - messages given to remote users when they # go into a certain directory.dirmessage_enable = YES ## Activate logging of uploads / downloads.xferlog_enable = YES ## Make sure PORT transfer connections originate from port 20 (ftp-data) .connect_from_port_20 = YES ## If you Want, you can arrange for uploaded anonymous files to be owned by # a different! note! using "root" for uploaded files is not # recomment! # chown_uploads = yes # chown_username =

whoever ## You may override where the log file goes if you like. The default is shown # below. # xferlog_file = / var / log / vsftpd.log ## If you want, you can have your log file in standard ftpd xferlog format # xferlog_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 ## 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 for ascii mode. # Beware That Turning ON A scii_download_enable enables malicious remote parties # to consume your I / O resources, by issuing the command "SIZE / big / file" in # ASCII mode. # These ASCII options are split into upload and download because you may wish # to enable ASCII uploads ( to prevent uploaded scripts etc. from breaking), # without the DoS risk of SIZE and ASCII downloads ASCII mangling should be # on the client anyway..ascii_upload_enable = YESascii_download_enable = YES ## You may fully customise the login banner string:. ftpd_banner = Welcome to Serv-U FTP SERSER. # (A real panic: EM02:) ###. 淘淘 淘淘 淘淘 淘淘 淘 店le ar = = c c = = = =

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_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 = YESchroot_local_user = YESlisten_port = 2121listen = yesguest_enable = YESguest_username = virtualpasv_min_port = 30000pasv_max_port = 30999pam_service_name = ftp.vuanon_world_readable_only = NOuser_config_dir = / etc / vsftpd_user_conf [/ quote: 1af834efb8] 2 content of my / etc / vsftpd_user_conf / download of. [quote: 1af834efb8] Anon_World_Readable_only = no [/ quote: 1af834efb8] 3. My / etc / vsftpd_use SUMMARY r_conf / upload of [quote: 1af834efb8] anon_world_readable_only = NOwrite_enable = YESanon_upload_enable = YESanon_mkdir_write_enable = YES [/ quote: 1af834efb8] 4. I / etc / vsftpd_user_conf / admin content [quote: 1af834efb8] anon_world_readable_only = NOwrite_enable = YESanon_upload_enable = YESanon_other_write_enable = YESANON_MKDIR_WRITE_ENABLE = YES [/ quote: 1af834efb8]

5. Self-started script, add / usr / local / sbin / vsftpdpd /etc/vsftpd.conf &

转载请注明原文地址:https://www.9cbs.com/read-73286.html

New Post(0)