How to use pure-ftpd to create anonymous ftp in Linux

小云云
Release: 2018-02-24 10:49:23
Original
2593 people have browsed it

This article mainly introduces how to use pure-ftpd to establish anonymous ftp in Linux. Friends who need it can refer to it. I hope it can help everyone.

(1) Use pure-ftpd to establish anonymous ftp access under ubuntu14.04

1. Installation

apt-get install pure-ftpd

2. Modify configuration

nano /etc/pure-ftpd/conf/NoAnonymous

Change to no

3. Create an anonymous user

# Create an ftp user
sudo useradd ftp

# Create an ftpgroup user group
sudo groupadd ftpgroup

# Add the ftp user to the ftpgroup group
sudo usermod -g ftpgroup ftp

# Create the ftp corresponding folder under /home
cd /home
mkdir ftp

# Modify the user and user group of the ftp folder
chown ftp:ftpgroup ftp

4. Restart pure-ftp

service pure-ftpd restart

(2) Use pure-ftpd to establish anonymous ftp access under CentOS 7

Pure-FTPd is an open source FTP service program on Linux.

The steps to install and configure Pure-FTPd on CentOS 7 are recorded below.

1. Install epel source:

yum install epel-release

2. Use yum command to install Pure-FTPd:

yum install pure-ftpd

3. Configure Pure-FTPd:

The location file is located at /etc/pure-ftpd/pure-ftpd .conf:
Edit:
vim /etc/pure-ftpd/pure-ftpd.conf

Comment out PAMAuthentication yes
# PAMAuthentication yes

Modify NoAnonymous to no
NoAnonymous no

4. Start the pure-ftpd service:

systemctl enable pure-ftpd
systemctl start pure-ftpd

5. Restart pure-ftpd

systemctl restart pure-ftpd

6. Firewall And SELinux Configuration

Allow the ftp service and port 21 via firewall.

firewall-cmd --permanent --add-port=21/tcp
firewall-cmd --permanent --add-service=ftp

Restart firewall:
firewall-cmd --reload

Update selinux (Then, update the SELinux boolean values ​​for FTP service):
setsebool -P ftp_home_dir on

Note: The anonymous ftp directory is /var/ftp

Add FTP user:

# pure-pw useradd UserName -u User -g Group -d /path/to/ftp/dir

UserName: FTP user
System users, such as apache or www-data, need to have read and write permissions for the ftp directory.
System user group, such as apache or www-data

/path/to/ftp/dir: FTP directory

For example:

# pure-pw useradd ftptest -u apache -g apache -d /var/www/blog/ftp

Password encryption is saved in /etc/pure-ftpd/pureftpd.passwd

Save Pure-FTPD user database:

# pure-pw mkdb
Make the added user effective:

# systemctl restart pure-ftpd

Now you can connect to FTP using the added fpt user and password server.

File transfer between FTP server and client is unencrypted and very unsafe, especially for sensitive information.

Related recommendations:

Detailed examples of PHP SFTP implementation of upload and download functions

Linux FTP account cannot delete folders What's going on

Linux shell ftp method to download files according to date

The above is the detailed content of How to use pure-ftpd to create anonymous ftp in Linux. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template