Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Quickly build a FTP server on CentOS7, based on local user access

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

This document focuses on the quick steps of building a FTP server based on local users on Linux.

If you want to learn more about FTP, such as the configuration of virtual users based on mysql, you should not refer to this document.

Reference document: http://www.178linux.com/52605

Https://help.aliyun.com/document_detail/51998.html

Here are the configuration steps:

1. Install vsftp

~] # yum install-y vsftp

2. Related configuration files

~] # cd / etc/vsftpd/vsftpd] # lsftpusers user_list vsftpd.conf vsftpd_conf_migrate.sh/etc/vsftpd/vsftpd.conf / / main configuration file, core configuration file / etc/vsftpd/ftpusers / / blacklist, in which users are not allowed to access the FTP server / etc/vsftpd/user_list / / whitelist, and the list of users allowed to access the FTP server

3. Start the service and add boot to start automatically.

Service startup and shutdown ~] # systemctl start vsftpd.service~] # systemctl enable vsftpd.service~] # netstat-antup | grep ftptcp 0 0 0.0 .0 netstat 21 0.0.0 0 LISTEN 2579/vsftpd tcp 0 0 10.1.252.97 7 V 21 10.1.250.64 5 4777 ESTABLISHED 2582/vsftpd

4. Use anonymous users to access

Vsftp default configuration: anonymous users can access the / var/ftp/pub directory, but can read but not write.

5. Configure local user login access

(1) create a local user and set the password

~] # useradd-d / var/www/html/-s / sbin/nologin wlm~] # passwd wlm

(2) modify the configuration file to enable local users to access

~] # vim / etc/vsftpd/vsftpd.conflocal_enable=YES if you don't want to use anonymous users, you can set it as follows: anonymous_enable=NO # allow anonymous users to log in

(3) modify directory permissions

The local user logs in. By default, the user's home directory is used. Configure the login user to be readable and writable to this directory.

If you want to change the root directory of the local user, you can specify: local_root=/local in the configuration file

~] # chmod otakw / var/www/html/~] # ll / var/www/drwxr-xrwx. 2 root root 63 May 12 11:53 html

(4) Login account test

Do not turn off anonymous user access. Enter ftp://host directly. By default, the anonymous user's pub directory is logged in. You can use ftp://username@host to specify the login account.

For example: ftp://wlm@10.10.10.3

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report