Linux FTP服务问题排查

一、问题描述

最近linux虚拟机重启之后发现,FTP服务总是不正常,工具无法连接。

二、排查及处理过程

1、检查ftp服务是否正常安装:yes

rpm -qa|grep vsftpd

2、检查ftp服务是否正常启动:

systemctl status vsftpd

启动vsftpd

systemctl start vsftpd

3、使用连接工具测试

MobaXterm FTP连接不成功,提示:

<<< 530 Please login with USER and PASS.

Error EElFTPSUnacceptedReplyError: Unaccepted server reply code 530 to command PWD

错误代码530通常表示用户没有登录或者登录失败,服务器因为权限问题拒绝了用户的登录请求。

原因:root用户没有配置ftp对应的路径和权限。

更改root用户登录成功:

Opening FTP connection to 192.168.146.130

FTP login with username ftpuser

<<< 220 (vsFTPd 3.0.2)

>>> USER ftpuser

<<< 331 Please specify the password.

>>> PASS ***********

<<< 230 Login successful.

>>> FEAT

<<< 250 Directory successfully changed.

>>> PWD

<<< 257 "/usr/ftproot"

>>> CWD /usr/ftproot

<<< 250 Directory successfully changed.

>>> PWD

<<< 257 "/usr/ftproot"

Opening directory /usr/ftproot...

>>> PWD

<<< 257 "/usr/ftproot"

>>> CWD /usr/ftproot

<<< 250 Directory successfully changed.

>>> TYPE A

<<< 200 Switching to ASCII mode.

>>> PASV

<<< 227 Entering Passive Mode (192,168,146,130,207,32).

>>> LIST

<<< 150 Here comes the directory listing.

<<< 226 Directory send OK.

>>> CWD /usr/ftproot

<<< 250 Directory successfully changed.

Directory /usr/ftproot opened. Showing file list...

三、配置FTP自动启动

为了确保FTP服务在系统启动时自动启动,可以使用以下命令启用FTP服务的自启动功能:

sudo systemctl enable vsftpd

修改完成后,保存修改并使用以下命令重启FTP服务:

sudo systemctl restart vsftpd

相关推荐
2401_892070981 天前
【Linux C++ 日志系统实战】LogFile 日志文件管理核心:滚动策略、线程安全与方法全解析
linux·c++·日志系统·日志滚动
雪可问春风1 天前
docker环境部署
运维·docker·容器
lwx9148521 天前
Linux-Shell算术运算
linux·运维·服务器
翻斗包菜1 天前
PostgreSQL 日常维护完全指南:从基础操作到高级运维
运维·数据库·postgresql
somi71 天前
ARM-驱动-02-Linux 内核开发环境搭建与编译
linux·运维·arm开发
双份浓缩馥芮白1 天前
【Docker】Linux 迁移 docker 目录(软链接)
linux·docker
海的透彻1 天前
nginx启动进程对文件的权限掌控
运维·chrome·nginx
黄昏晓x2 天前
Linux ---- UDP和TCP
linux·tcp/ip·udp
路溪非溪2 天前
Linux驱动开发中的常用接口总结(一)
linux·运维·驱动开发
此刻觐神2 天前
IMX6ULL开发板学习-01(Linux文件目录和目录相关命令)
linux·服务器·学习