DarkMatter in Cyberspace
  • Home
  • Categories
  • Tags
  • Archives

Install FTP Service for CentOS Host behind a Proxy


Basic Installation

  1. add "proxy=http://10.21.3.31:8087" to /etc/yum.conf;

  2. run command "yum install -y vsftpd" with root;

  3. run "service vsftpd start" with root. Now you can use ftp with a common user;

Enable upload and create directory

Run following command with root accout (or there will raise 553 and 550 errors when you upload and create dir):

setsebool allow_ftpd_full_access on
setsebool ftp_home_dir on
/sbin/service vsftpd restart

Verify:

$ nc -zv 10.0.2.49 21

or

$ ftp 10.0.2.49

then enter username and password. Any existing user account can be used.

If you get following errors, it's probably due to the fiirwall. See the next section for solutions.

nc: connect to 10.0.2.49 port 21 (tcp) failed: No route to host

Ref:

google "vsftpd 553 centos"; Starting and Stopping vsftpd

Config Firewall

First you should test if the connection failure is caused by iptables:

# service iptables stop

and connect the ftp again. If you can logged in, then you should config iptables rules.

Add a rule in iptables to open access for port 21:

Open file /etc/sysconfig/iptables:

Add "-A INPUT -i eth0 -p tcp --dport 21 -j ACCEPT" after the line "-A INPUT -i lo -j ACCEPT". Then restart service:

# service iptables restart

Verify again.



Published

Sep 9, 2013

Last Updated

Sep 9, 2013

Category

Tech

Tags

  • CentOS 25
  • ftp 7

Contact

  • Powered by Pelican. Theme: Elegant by Talha Mansoor