Linux Enable FTP service and connections

Source: Internet
Author: User
Tags ftp connection file permissions

The system of the virtual machine is centos6.3

The first step. Start FTP

Service VSFTPD Restart

Hint VSFTPD: Unrecognized service

The workaround is to upgrade the VSFTPD service

Yum Install vsftpd

Re-restart the service successfully.

grep  +

found that port 21 is indeed in listen listening state

The second step.

Virtual Machine Use commands

Tcpdump-i ETH0-NNX Port 21

21-Port Packet for crawling the first NIC IP, in hexadecimal display

Use commands at the command line of the real machine (192.168.2.102 is the IP of the virtual machine)

FTP 192.168.2.102

Attempt to establish an FTP connection with a virtual machine

found that although the virtual machine can catch the package, but the real machine is not prompted to enter the user name and password, that is, did not connect successfully

The third step is to find the iptables firewall problem.

Servcie iptables Stop

Used to temporarily shut down the firewall

Chkconfig iptables off

For permanently shutting down the firewall

Fourth step. Execute the command in the second step, you need to enter a user name and password.

But then immediately prompt

 oops:cannot Change directory:/home/user1  Oops:child died remote host closes the connection. 

Troubleshoot the following possible

    1. Does the directory for the user is trying to login as even exist?
    2. Check file permissions for the directory being accessed to ensure the directory can is read, but also have execute per Missions.
    3. Check SELINUX. Might need to disable to get vstftpd to work. Not a ideal situation if you need SELINUX active, but at least you'll know what's the cause of your error is.

Discovery is a problem with the SELinux security module.

The orders and documents relating to SELinux:

To view the SELinux status:

1,/usr/sbin/sestatus-v # #如果SELinux The status parameter is enabled is turned on

SELinux status:enabled

2. Getenforce # #也可以用这个命令检查

To turn off SELinux:

1, temporarily shut down (do not restart the machine):

Setenforce 0 # #设置SELinux become permissive mode

# #setenforce 1 set SELinux to become enforcing mode

2. Modify the configuration file to restart the machine:

Modify the/etc/selinux/config file

Change Selinux=enforcing to Selinux=disabled

Restart the machine

Fifth step. Input successful, login successful

Linux Enable FTP service and connections

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.