421 Service not available, remote server has closed connection,Vsftpd 賬號登入自動斷開連接


System version:Linux centos7_server 3.10.0-693.el7.x86_64 #1 SMP Tue Aug 22 21:09:27 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
[root@centos7_server ~]# ftp 1.1.1.1
Connected to 1.1.1.1(1.1.1.1).
220 (vsFTPd 3.0.2)
Name (1.1.1.1:root): MyD
331 Please specify the password.
Password:
500 OOPS: vsftpd: refusing to run with writable root inside chroot()
Login failed.
421 Service not available, remote server has closed connection
ftp>
[root@centos7_server ~]# vim /etc/vsftpd/vsftpd.conf
在配置文件內寫入 allow_writeable_chroot=YES, 給賬戶加入寫入權限。
隨后重新啟動vsftpd服務, 如果一次解決不了,那就兩次。
[root@centos7_server ~]# ftp 1.1.1.1
Connected to 1.1.1.1(1.1.1.1).
220 (vsFTPd 3.0.2)
Name (1.1.1.1:root): MyD
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>


特別補充說明,以上作業動作僅僅是關閉了 Iptables 及 Firewalld,SELinux是開啟狀態,對SELinux有做一項動作。
systemctl stop iptables 關閉iptables
systemctl stop fireawlld 關閉firewalld
[root@centos7_server ~]# getsebool -a | grep ftpd
ftpd_anon_write --> off
ftpd_connect_all_unreserved --> off
ftpd_connect_db --> off
ftpd_full_access --> off 把ftpd_full_access 設置為 ftpd_full_access on
ftpd_use_cifs --> off
ftpd_use_fusefs --> off
ftpd_use_nfs --> off
ftpd_use_passive_mode --> off
[root@centos7_server ~]# setsebool -P ftpd_full_access on 這個指令的大意為:開啟SELinux域中對ftp服務的允許策略
[root@centos7_server ~]# getsebool -a | grep ftpd
ftpd_anon_write --> off
ftpd_connect_all_unreserved --> off
ftpd_connect_db --> offftpd_full_access --> on
ftpd_use_cifs --> off
ftpd_use_fusefs --> off
ftpd_use_nfs --> off
ftpd_use_passive_mode --> off
[root@centos7_server ~]#


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM