Install FTP in Redhat and Ubuntu

Source: Internet
Author: User

 

1. Redhat install FTP

 

1. First, check whether vsftp is installed.

[Root @ localhost root] # rpm-qa | grep vsftpd

Vsftpd-1.1.3-8

VSFTP is not installed. Download channel:

Http://download.csdn.net/detail/chenyong19871223/3877250

Install VSFTPD

[Root @ localhost tmp] # rpm-ivh vsftpd-1.1.3-8.i386.rpm

Warning: vsftpd-1.1.3-8.i386.rpm: Header V3 DSA signature: NOKEY, key ID db42a60e

Preparing... ######################################## ### [100%]

1: vsftpd ####################################### #### [100%]

[Root @ localhost tmp] # which vsftpd

/Usr/sbin/vsftpd

2. Now you can start vsftp directly.

[Root @ localhost root] #/etc/rc. d/init. d/vsftpd start

Starting vsftpd for vsftpd: [OK]

3. control other users

The file structure of vsftpd has only one main configuration file:/etc/vsftpd. conf. The modifications are mainly made around it,

In addition, there are some additional files, which I will explain as follows:

/Etc/pam. d/vsftpd

The pam Authentication is defined here. It is verified according to the/etc/vsftpd. ftpusers file,

Users listed in this file cannot log on to ftp

/Etc/vsftpd. user_list

This file takes effect after the parameters userlist_enable and userlist_deny in the configuration file vsftd. conf are set to YES. Users listed in this file cannot log on to the ftp

 

Note: The above two files seem to have the same functions, but they are not actually vsftpd. ftpusers is required when the plug-in PAM program is used for verification, while vsftd. user_list is the authentication mechanism of vsftp. that is, dual verification is undoubtedly more secure. since the functions are the same, it is best to write the same content for the two files./etc/vsftpd. chroot_list this file must be created by yourself when vsftpd. after the chroot_list_enable and chroot_list_file parameters in conf are enabled, users in this file can only perform activities in their home directories after logging on to ftp, and cannot go around. /var/main directory after anonymous ftp users log on.

Note: ftp can be used in two ways.

Active: when the client connects to the control port (21) of the server, when data needs to be transmitted, the server actively opens port (20) to connect to the client.

Passive: the connection method of the control port is the same as above, except that when data is to be transferred, vsftpd is still used for the client to initiate the connection on redhat, Which is configured.

 

Ii. install FTP in Ubuntu

1. Install vsftpd

Sudo apt-get install vsftpd

2. Configure vsftpd

Sudo vi/etc/vsftpd. conf

The Edit content is as follows:

# Set the system's local user account to log on to ftp

Local_enable = YES

# Use the user's local account directory as the ftp directory

Chroot_local_user = YES

# Allow users to upload files www.2cto.com

Write_enable = YES

Save the modification and restart vsftpd.

Sudo/etc/init. d/vsftpd restart

3. Add an ftp user

Sudo useradd-d/home/ftp_testuser-m ftp_testuser

Sudo passwd ftp_testuser

Then you can use ftp_testuser and the set password to log on to ftp.

 

Author: cameory

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.