search
HomeSystem TutorialLINUXUse FTP server user liwu to try to log in. 8. Troubleshooting ideas

Table of contents

1. FTP service 1. FTP contract introduction

FTP is a file transfer contract. It is a TCP-based contract and adopts the customer/server model. Through the FTP contract, users can upload or download files on the FTP server.

Use ports TCP 20 and 21:

Port 20: used to build data connections and transfer file data.

21 port: used to build control connections.

Disadvantages: Data cannot be automatically synchronized and needs to be automatically synchronized.

2. FTP service principle

FTP services are divided into 2 typeslinux adds ftp servicelinux operating system version, active connection and passive connection.

添加服务器_linux添加ftp服务_添加服务卡

Active connection principle:

Passive connection principle:

3. Configuration file path

Service configuration file:/etc/vsftpd/vsftpd.conf

Blacklist configuration file:/etc/vsftpd/user_list

Default root directory of anonymous user FTP service: /var/ftp

Default root directory of local user FTP service: /home/Account file with the same name

Error log path:/var/log/messages

2. FTP server setup 1. Build environment

centos7.4 system virtual machine onelinux add ftp service, configure to turn off the firewall and selinux.

systemctlstopfirewalld #关闭防火墙
setenforce0#关闭selinux

2. Detect the environment and install the ftp service

rpa -q vsftpd#检查是否安装ftp服务
yum-y installvsftpd#安装ftp服务

3. Back up the configuration file and add users

useraddlisi #添加lisi用户
useraddliwu #添加liwu用户
echo '123456' |passwd --stdinlisi #设置账户lisi的密码为123456
echo '123456' |passwd --stdinliwu #设置账户lisi的密码为123456
cd/etc/vsftpd/ #进入ftp配置文件目录
cp vsftpd.conf vsftpd.conf.bak#备份配置文件 

4. FTP configuration file analysis

anonymous_enable=YES 
#允许匿名用户访问(账户名为ftp,不需要密码),默认允许建议关闭
local_enable=YES
#允许本地用户访问(本地可登录账户)
write_enable=YES
#开放服务器的写权限,上传文件到服务器必须开启,默认开启
local_umask=022
#本地用户文件权限反掩码,文件权限777-umask,文件权限666-umask
dirmessage_enable=YES
#开启日志消息,默认开启
xferlog_enable=YES
#开启上传现在日志,默认开启
connect_from_port_20=YES
#确保端口数据传输来自20端口,默认开启
xferlog_std_format=YES
#日志文件设置为标准ftpd xferlog格式,默认开启,日志位置/var/log/xferlog
chroot_local_user=YES
#将用户访问权限限制在用户自己的根目录下,默认关闭。
allow_writeable_chroot=YES
#允许被限制用户对自己根目录进行写操作
anon_root=/var
#设置本地用户的默认根目录为/var,注意需要此目录给其他用户读写权限才可上传下载
userlist_enable=YES
#开启user_list用户列表,文件位置/etc/vsftpd/user_list,默认关闭
userlist_deny=YES
#若user_list是开启状态userlist_deny=YES是黑名单文件中的用户不能登录,默认关闭
#若user_list是开启状态,userlist_deny=NO则只允许user_list中的用户登录

5. Configure local users to access ftp

6. Enable ftp service

systemctlstartvsftpd #开启vsftpd服务
systemctlstatus vsftpd #查看vsftpd服务状态

7. Verification service

①Configure read and write permissions for other users in the /mnt directory

chmod766 -R /mnt #修改/mnt目录用户其他权限具有读写权限

② Configure the liwu user into the user_list file in the blacklist, the file location is /etc/vsftpd/user_list

③Create an a.txt file under /mnt with the content of 123

④Open your own windows computer cmd window and enter the ftp server IP to log in with the account password

⑤The file path downloaded to the local area is under C:Users

⑥Delete the a.txt under /mnt and upload the local a.txt.

添加服务卡_添加服务器_linux添加ftp服务

⑦. Use blacklist user liwu to try to log in

8. Troubleshooting ideas

①First check whether the local firewall, ftp firewall and selinux are turned off

②Check the configuration file content for errors

③ Check whether the service status is normal. Linux restart command. If it is not normal, check the /var/log/messages log for troubleshooting.

④The default root directory of anonymous users cannot have read permissions, otherwise they will not be able to connect to the ftp server

⑤You can get but cannot put to view the permissions and ownership of the root directory

The above is the detailed content of Use FTP server user liwu to try to log in. 8. Troubleshooting ideas. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:ITcool. If there is any infringement, please contact admin@php.cn delete
How does the command line environment of Linux make it more/less secure than Windows?How does the command line environment of Linux make it more/less secure than Windows?May 01, 2025 am 12:03 AM

Linux'scommandlinecanbemoresecurethanWindowsifmanagedcorrectly,butrequiresmoreuserknowledge.1)Linux'sopen-sourcenatureallowsforquicksecurityupdates.2)Misconfigurationcanleadtovulnerabilities.Windows'commandlineismorecontrolledbutlesscustomizable,with

How to Make a USB Drive Mount Automatically in LinuxHow to Make a USB Drive Mount Automatically in LinuxApr 30, 2025 am 10:04 AM

This guide explains how to automatically mount a USB drive on boot in Linux, saving you time and effort. Step 1: Identify Your USB Drive Use the lsblk command to list all block devices. Your USB drive will likely be labeled /dev/sdb1, /dev/sdc1, etc

Best Cross-Platform Apps for Linux, Windows, and Mac in 2025Best Cross-Platform Apps for Linux, Windows, and Mac in 2025Apr 30, 2025 am 09:57 AM

Cross-platform applications have revolutionized software development, enabling seamless functionality across operating systems like Linux, Windows, and macOS. This eliminates the need to switch apps based on your device, offering consistent experien

Best Linux Tools for AI and Machine Learning in 2025Best Linux Tools for AI and Machine Learning in 2025Apr 30, 2025 am 09:44 AM

Artificial Intelligence (AI) is rapidly transforming numerous sectors, from healthcare and finance to creative fields like art and music. Linux, with its open-source nature, adaptability, and performance capabilities, has emerged as a premier platfo

5 Best Lightweight Linux Distros Without a GUI5 Best Lightweight Linux Distros Without a GUIApr 30, 2025 am 09:38 AM

Looking for a fast, minimal, and efficient Linux distribution without a graphical user interface (GUI)? Lightweight, GUI-less Linux distros are perfect for older hardware or specialized tasks like servers and embedded systems. They consume fewer res

How to Install Wine 10.0 in RedHat DistributionsHow to Install Wine 10.0 in RedHat DistributionsApr 30, 2025 am 09:32 AM

Wine 10.0 stable version release: Running Windows applications on Linux to a higher level Wine, this open source and free application, allows Linux users to run Windows software and games on Unix/Linux operating systems, ushering in the release of the 10.0 stable version! This version has been provided with source code and binary package downloads, and supports various distributions such as Linux, Windows and Mac. This edition embodies a year of hard work and over 8,600 improvements, bringing many exciting improvements. Key highlights include: Enhanced support for Bluetooth devices. Improve support for HID input devices. Optimized performance of 32-bit and 64-bit applications.

How to Install and Configure SQL Server on RHELHow to Install and Configure SQL Server on RHELApr 30, 2025 am 09:27 AM

This tutorial guides you through installing SQL Server 2022 on RHEL 8.x or 9.x, connecting via the sqlcmd command-line tool, database creation, and basic querying. Prerequisites Before beginning, ensure: A supported RHEL version (RHEL 8 or 9). Sudo

How to Install Thunderbird 135 on a Linux DesktopHow to Install Thunderbird 135 on a Linux DesktopApr 30, 2025 am 09:26 AM

Mozilla Thunderbird 135: Powerful cross-platform mail client Mozilla Thunderbird is a free, open source, cross-platform email, calendar, news, chat and contact management client designed to efficiently handle multiple email accounts and news sources. On February 5, 2025, Mozilla released the Thunderbird 135 version, introducing a number of new features, performance improvements and security fixes. Thunderbird 135 main features: XZ Packaging for Linux Binaries: Smaller files, faster unpacking, and better integration with modern distributions. Cookie storage support: when creating space

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)