published on April 13, 2014 by Scka, author
Recently built servers with Linux
Set up the FTP when the decision to use the VSFTP build, but there is no normal connection and unable to upload files and many other issues
After a long time of efforts, finally let vsftp normal operation
The following one by one gives my solution
1. Turn off the firewall
After installing the VSFTP with Yum and configuring it to finish booting, I found that I was not receiving a response when I connected to ftp locally.
It's not even a welcome message, it's a very unusual situation.
Check that the VSFTP configuration file is correct and the program is running properly
So I suspect that the firewall
Run the above command temporarily shut down the firewall, you can normally receive the system sent welcome message
2. Set permissions
I was using an account named Scka to connect to FTP, but I received the following feedback
oops:cannot Change Directory:/home/scka
From the error message, it should be the switch to the home directory/home/scka errors occurred, so I tried to execute the following command
This should solve the problem after this operation, but still receive the error message
3. Set Sebool
It suddenly occurred to me that the Linux I was using turned on the Sebool by default, could it be blocked by the connection?
Then run the command below to get sebool all the settings for FTP
Sure enough, we found some problems.
Depending on the feedback, it seems that many of the settings for FTP are off, and I pay particular attention to the Ftp_home_dir, which seems to be related to the problem I have just appeared
Then try to run the following command to resolve
1 |
Setsebool ftp_home_dir 1 |
Restart VSFTPD, and then reconnect to FTP, sure enough to return to the home directory successfully!
However, the reboot will fail after this setting, we need to make a permanent setting
1 |
Setsebool -P ftp_home_dir 1 |
4, further solve the problem of unable to upload files
Connection on the FTP I again try to upload files, but again received an error message, no permissions
First think of permissions problem, run chmod 777 directory name after the problem is still
It suddenly occurred to me that a few options were off in the Sebool.
123 |
setsebool allow_ftpd_full_access 1 setsebool allow_ftpd_use_cifs 1 setsebool allow_ftpd_use_nfs 1 |
Use the above command to open them all, and then reconnect the FTP, the problem is solved perfectly
The problem of using VSFTPD to connect and unable to upload files under Centos 6.4 is resolved