记一次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
随机推荐
- MySQL锁的用法之行级锁
行级锁是MySQL中粒度最小的一种锁,他能大大减少数据库操作的冲突.但是粒度越小,实现的成本也越高.MYISAM引擎只支持表级锁,而INNODB引擎能够支持行级锁,下面的内容也是针对INNOD ...
- H3C 命令行帮助特性
- @游记@ CQOI2019(十二省联考)
目录 @day - 0@ @day - 1@ @day - 2@ @后记@ 我只是来打酱油哒-- 顶多能进个 E 类继续打酱油. 原本还在互奶 A 队,结果现在--铁定进不了队啦. 对初中生的歧视啊 ...
- js毫秒数转天时分秒
formatDuring: function(mss) { var days = parseInt(mss / (1000 * 60 * 60 * 24)); var hours = pars ...
- zoj 1633 Big String
Big String Time Limit: 2 Seconds Memory Limit: 65536 KB We will construct an infinitely long string ...
- 深入理解String、StringBuffer、StringBuilder(转)
文章系转载,非原创,原地址: http://www.cnblogs.com/dolphin0520/p/3778589.html 相信String这个类是Java中使用得最频繁的类之一,并且又是各大公 ...
- webpack学习(四)配置plugins
1 plugins是什么??? 如果学过vue和react肯定知道生命周期函数,而生命周期函数实际上就是当程序运行在某个时刻一定会发生的函数. plugins其实也是如此,我们在项目中配置相应的plu ...
- ArrayList中remove方法和set(null)的区别
在分析源码ArrayList.remove()时,偶然发现了一个疑惑的点,就是:源码也是将最后一个对象的引用指向null(源码:elementData[--size] = null; // clear ...
- codeforce 380(div.2)
A B 略 C:二分,贪心 设d(i, v)为 剩余油量为v时,车开距离i 所需要的最小时间,使用线性规划不难算出: if v < i return INF; //无法到达 if v > ...
- call undefined function openssl_cipher_iv_length
现象: 访问localhost/blog/public时,报错在verdor/framework/src/Illuminate/Encryption/Encrtpter.php的84行,找不到open ...