记一次ftp错误
在一个ftp上,突然登不上 报错,使用浏览器登录,报此用户不是私密连接,然后使用服务器客户端登录尝试,错误信息如下:
[root@test ~]# ftp *.*.*.*
Connected to *.*.*.* (*.*.*.*).
(vsFTPd 3.0.)
Name (*.*.*.*:root): ftpuser
Please specify the password.
Password:
Login incorrect. #530错误
Login failed.
ftp> exit
去服务端排错
检查配置文件
[root@localhost data]# cat /etc/vsftpd/vsftpd.conf
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=
dirmessage_enable=YES
xferlog_enable=YES
xferlog_file=/var/log/xferlog
chroot_local_user=YES
listen=YES
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
查看/etc/pam.d/vsftpd
[root@localhost ~]# vim /etc/pam.d/vsftpd
#%PAM-1.0
session optional pam_keyinit.so force revoke
auth required pam_listfile.so item=user sense=deny file=/etc/vsftpd/ftpusers onerr=succeed
auth required pam_shells.so
auth include password-auth
account include password-auth
session required pam_loginuid.so
session include password-auth
[root@localhost ~]# vim /etc/vsftpd/ftpusers
# Users that are not allowed to login via ftp
root
bin
#daemon #注释掉
adm
lp
sync
shutdown
halt
news
uucp
operator
games
nobody
[root@localhost ~]# systemctl restart vsftpd
尝试
[root@test ~]# ftp *.*.*.*
Connected to *.*.*.* (*.*.*.*).
(vsFTPd 3.0.)
Name (*.*.*.*:root): ftpuser
Please specify the password.
Password:
OOPS: vsftpd: refusing to run with writable root inside chroot() #报500错误
Login failed.
Service not available, remote server has closed connection
ftp> exit
新的错误原因是因为我们限定了用户不能跳出其主目录之后,使用该用户登录FTP时往往会遇到这个错误
这个问题是由于在2.3.5之后,vsftpd增强了安全检查,如果用户被限定在了其主目录下,则该用户的主目录不能再具有写权限了!如果检查发现还有写权限,就会报该错误。
要修复这个错误,可以用命令chmod a-w /home/user去除用户主目录的写权限,注意把目录替换成你自己的。或者你可以在vsftpd的配置文件中增加下列两项中的一项:
allow_writeable_chroot=YES #增加对自己家目录的写权限
然后查看自己服务器的目录权限
[root@localhost ~]# ll /data/
drwsrwsrwt. root root Apr : ftp #权限问题
修改权限:
[root@localhost ~]# chmod u-s /data/ftp
[root@localhost ~]# chmod g-s /data/ftp
[root@localhost ~]# chmod o-t /data/ftp
[root@localhost ~]# chmod u-w /data/ftp
[root@localhost ~]# chmod g-w /data/ftp
[root@localhost ~]# chmod o-w /data/ftp
[root@localhost ~]# ll /data/ftp
dr-xr-xr-x. root root Apr : ftp
重新登录
[root@test ~]# ftp *.*.*.*
Connected to *.*.*.* (*.*.*.*).
(vsFTPd 3.0.)
Name (*.*.*.*:root): ftpuser
Please specify the password.
Password:
Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.ftp> ls
Entering Passive Mode (*,*,*,*,,).
Here comes the directory listing.
drwxrwxrwx Apr : nginx1
drwxrwxrwx Feb : nginx2
drwxrwxrwx Feb : nginx3
drwxrwxrwx Apr : nginx4
drwxrwxrwx Apr : nginx5
Directory send OK.
ftp> exit
Goodbye.
成功登陆,问题解决!!!
记一次ftp错误的更多相关文章
- 记一次ftp服务器搭建走过的坑
记一次ftp服务器搭建走过的坑 1.安装 ①下载 wget https://security.appspot.com/downloads/vsftpd-3.0.3.tar.gz #要FQ ②解压 ta ...
- ftp错误&&详解方案
一.FTP错误代码列表150 文件状态良好,打开数据连接 200 命令成功 202 命令未实现 211 系统状态或系统帮助响应 212 目录状态 213 文件状态 214 帮助信息,信息仅对人类用户有 ...
- 记一次ftp服务器错误 centOS 6.4 vsftpd 500 illegal port command
这个错误是因为是主动模式的,应该改为被动模式 以下是操作过程: iptables中加 -A INPUT -p tcp -m state --state NEW -m tcp --dport 10221 ...
- 记一次sparkOnyarn错误:java.lang.UnsatisfiedLinkError
错误大概这样: Caused by: java.util.concurrent.ExecutionException: Boxed Error Caused by: java.lang.Unsatis ...
- FTP错误 [ftp: connect: No route to host] 解决方法
问题: 昨天在局域网内的两台机器上用ftp命令传文件.因为是新机器所以没安装ftp. 分别在两台机器上安装了ftp的服务端和客户端,并启动了ftp服务器进程. 当用启动ftp连接另一台机器时发生了如下 ...
- 记一个mvn奇怪错误: Archive for required library: 'D:/mvn/repos/junit/junit/3.8.1/junit-3.8.1.jar' in project 'xxx' cannot be read or is not a valid ZIP file
我的maven 项目有一个红色感叹号, 而且Problems 存在 errors : Description Resource Path Location Type Archive for requi ...
- 记一次FTP上传文件总是超时的解决过程
好久没写博,还是重拾记录一下吧. 背景:买了一个阿里云的云虚拟机用来搭建网站(起初不了解云虚拟主机和云服务器的区别,以为都是有SSH功能的,后来发现不是这样样子啊,云虚拟机就是FTP上传网页+MySQ ...
- 记一个Oracle存储过程错误
下面一个存储过程是创建一个job,在5秒后更新一个表: create or replace PROCEDURE P_TEST AS jobno number; BEGIN dbms_job.submi ...
- FTP 错误1
530-Valid hostname is expected. 所以,当通过主机名连接到FTP之后,输入用户名的时候,采用以下格式:主机名|用户名例如:ftp1.sdsxw.com|tom
随机推荐
- 二维数组初始化 遍历 动态赋值 内存图 Day08
package com.sxt.arraytest3; /* * 二维数组 */ public class TestArray { public static void main(String[] a ...
- 文字渐变效果:图层中的mask属性
http://www.cocoachina.com/ios/20150716/12571.html 前言 已经很久没写blog了,最近发生了太多事情,失去了生命中一位很重要的成员,使我不得不放下对技术 ...
- 2018-8-10-win10-uwp-使用动画修改-Grid-column-的宽度
title author date CreateTime categories win10 uwp 使用动画修改 Grid column 的宽度 lindexi 2018-08-10 19:17:19 ...
- 《C语言深度解剖》学习笔记之预处理
第3章 预处理 1.下面两行代码都是错的.因为注释先于预处理指令被处理,当这两行被展开成“//……”和“/*……*/”时,注释已处理完毕,所以出现错误 #define BSC // #define B ...
- 创建我的flask第一个应用(一)
本地python版本 (venv) dongge@dongge-PC:/data/webroot$ python --version Python 3.6.5 创建flask命令 $mkdir myp ...
- PMC亮相IDF展示12G SAS分层存储解决方式
引领大数据连接.传送以及存储,提供创新半导体及软件解决方式的PMC公司(纳斯达克代码:PMCS)出席了2014年4月2-3日在深圳举办的2014 IDF英特尔开发人员论坛. 此次,PMC将在 1层展示 ...
- hdu 3832 Earth Hour(最短路变形)
Earth Hour Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 125536/65536 K (Java/Others)Total ...
- HDU3336 Count the string 题解 KMP算法
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3336 题目大意:找出字符串s中和s的前缀相同的所有子串的个数. 题目分析:KMP模板题.这道题考虑 n ...
- uva 100 The 3n + 1 problem (RMQ)
uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem= ...
- spring mvc 接收表单 bean
spring MVC如何接收表单bean 呢? 之前项目中MVC框架一直用struts2,所以我也就按照struts2 的思维来思考 页面loginInput.jsp: <?xml versio ...