421 service not available, remote server has closed connection

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
Add write access to the account by writing allow_writeable_chroot=YES in the configuration file.
Then restart the vsftpd service, and if that doesn’t work once, then twice.
[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>

Special note, the above action is only to close Iptables and Firewalld, SELinux is on, there is an action to SELinux.
systemctl stop iptables colse iptables
systemctl stop fireawlld colsefirewalld
[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 set as 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 This command has the following meaning: Enable the permission policy for the ftp service in the SELinux domain
[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 ~]#

Similar Posts: