setsebool allow_ftpd_full_access on
setsebool -P ftp_home_dir on

vsftpd (Very Secure File Transport Protocol Daemon) is a secure, fast FTP server for Unix/Linux systems. In this how-to article, let us see how to setup a basic FTP server using vsftpd on CentOS 6.5. This procedure will also work on all RHEL CentOS, Scientific Linux 6.x versions.

My testbox server hostname and IP Address are server.unixmen.local and 192.168.1.101/24 respectively. Change the values as per your scenario.

Install vsftpd

All commands should be run with ‘root’ user. Run the following command in terminal to install vsftpd package:

# yum install vsftpd ftp -y

Configure vsftpd

Edit vsftpd configuration file /etc/vsftpd/vsftpd.conf,

# vi /etc/vsftpd/vsftpd.conf

Find the following lines and make the changes as shown below:

 [...]
## Set to "NO" ##
anonymous_enable=NO ## Uncomment ##
ascii_upload_enable=YES
ascii_download_enable=YES ## Uncomment - Enter your Welcome message - This is optional ##
ftpd_banner=Welcome to UNIXMEN FTP service. ## Add at the end of this  file ##
use_localtime=YES

Start the vsftpd service and make it to start automatically on every reboot:

# service vsftpd start
# chkconfig vsftpd on

Create FTP users

By default, root user is not allowed to login to ftp server for security purpose. So let us create a testing user called“sk” with password “centos”:

# useradd sk
# passwd sk

Connecting to FTP server

Now let us try to connect to FTP server itself with user “sk”:

# ftp 192.168.1.101
Connected to 192.168.1.101 (192.168.1.101).
220 Welcome to UNIXMEN FTP service.
Name (192.168.1.101:root): sk
331 Please specify the password.
Password:
500 OOPS: cannot change directory:/home/sk
Login failed.
ftp>

Probably you will get an error like “500 OOPS: cannot change directory”.

This is because your SELinux restricts the user to log in to ftp server. So let us update the SELinux boolean values for FTP service:

# setsebool -P ftp_home_dir on

Now try again to login to FTP server:

# ftp 192.168.1.101
Connected to 192.168.1.101 (192.168.1.101).
220 Welcome to UNIXMEN FTP service.
Name (192.168.1.101:root): sk
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>

Now you will be able to login to FTP server without any problems.

Client side configuration

Let me try to log in to the FTP server from my Ubuntu client system.

$ ftp 192.168.1.101
ftp: connect: No route to host
ftp>

You might see the above error like “ftp:connect:No route to host”. To resolve this error, allow the default ftp port“21″ through your firewall or router. In the server side, do the following.

Edit file /etc/sysconfig/iptables,

# vi /etc/sysconfig/iptables

Add the following lines.

[...]
-A INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT
[...]

Save and exit the file. Restart iptables now:

# service iptables restart

Now try again from the client system to login to FTP server:

$ ftp 192.168.1.101
Connected to 192.168.1.101.
220 Welcome to UNIXMEN FTP service.
Name (192.168.1.101:sk): sk
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>

Boom!! It’s working now.

Setup FTP Server On CentOS, RHEL, Scientific Linux 6.5/6.4/6.3的更多相关文章

  1. Install LAMP Server (Apache, MariaDB, PHP) On CentOS/RHEL/Scientific Linux 7

    Install LAMP Server (Apache, MariaDB, PHP) On CentOS/RHEL/Scientific Linux 7 By SK  - August 12, 201 ...

  2. 在CentOS/RHEL/Scientific Linux 6下安装 LAMP

    LAMP 是服务器系统中开源软件的一个完美组合.它是 Linux .Apache HTTP 服务器.MySQL 数据库.PHP(或者 Perl.Python)的第一个字母的缩写代码.对于很多系统管理员 ...

  3. setup FTP server on CentOS 7

    Setup FTP Server on CentOS 7 Install vsftpd vsftpd (Very Secure File Transport Protocol Daemon) is a ...

  4. Setup VSFTPD Server with Virtual Users On CentOS, RHEL, Scientific Linux 6.5/6.4/6.3

    We have already shown you How to Setup VSFTPD Server on CentOS 6.5/6.4 in our previous article. In t ...

  5. linux之 CentOS/RHEL/Scientific Linux 6 & 7上安装Telnet

    声明: 在安装和使用Telnet之前,需要记住以下几点. 在公网(WAN)中使用Telnet是非常不好的想法.它会以明文的格式传输登入数据.每个人都可以看到明文.如果你还是需要Telnet,强烈建议你 ...

  6. Setup FTP server on Ubuntu 14.04

    Setup FTP server on Ubuntu 14.04 Step 1 » Update repositories .krizna@leela:~$ sudo apt-get updateSt ...

  7. Setup Git Server in CentOS 6.3

    0. Environment: Server machine: CentOS 6.3 x86 Client machine: Windows 10 Pro x86_64 1. Install ssh ...

  8. Ubuntu setup ftp server.

    http://www.cnblogs.com/bcsflilong/p/4200139.html Steps 1. Install vsftpd sudo apt-get install vsftpd ...

  9. setting up a IPSEC/L2TP vpn on CentOS 6 or Red Hat Enterprise Linux 6 or Scientific Linux

    This is a guide on setting up a IPSEC/L2TP vpn on CentOS 6 or Red Hat Enterprise Linux 6 or Scientif ...

随机推荐

  1. CPSR和SPSR(转)

    转载地址:http://blog.chinaunix.net/uid-28458801-id-3487199.html CPSR:程序状态寄存器(current program status regi ...

  2. zabbix邮件告警

    Zabbix邮件告警看了很多文档,写的那叫一个蛋疼,明明没有发出去邮件,硬要糊弄观众,我也跟着被糊弄. 操作系统环境: CentOS 5.5 x84_64位 Zabbix版本2.2.3 Web服务器: ...

  3. C#Stimulator项目>>>C/C++ DLL的生成和调用,Windows下的多线程

    Windows下的多线程 http://blog.csdn.net/ganpengjin1/article/category/2541791 使用C/C++建立DLL,环境VS2013 新建Win32 ...

  4. Deploy maven on Linux OS

    1.首先到Maven官网下载安装文件,目前最新版本为3.0.3,下载文件为apache-maven-3.0.3-bin.tar.gz,下载可以使用wget命令: 2.进入下载文件夹,找到下载的文件,运 ...

  5. 博客搬家到 http://fresky.github.io/ - Visual Studio的插件Pdbproj可以把pdb转换成C++项目

    博客搬到了Dawei XU,请各位看官挪步.最新的一篇是:Visual Studio的插件Pdbproj可以把pdb转换成C++项目.

  6. load 与initialize的调用顺序小结

    开发中实用方法固然是最贴近应用的,当一些程序原理还是要先搞清晰,根据查找的一些资料,总结了一些load与initialize的调用. APP启动到执行main函数之前,程序就执行了很多代码   执行顺 ...

  7. Jmeter聚合报告分析

    Label:每个 JMeter 的 element(例如 HTTP Request)都有一个 Name 属性,这里显示的就是 Name 属性的值 Average:平均响应时间--默认情况下是单个 Re ...

  8. 即时通讯(IM)

    即时通讯(IM)功能是APP的重要功能之一,而开发好移动IM却绝非易事.通常来说,IM技术选型至少要解决以下问题:1. 协议选型 2. IM服务器选型 3. 对协议和服务器做相应修改,通常来说直接拿个 ...

  9. VSS的运用小内容(针对于vs2008版本)(小的问题都是,仅供参考--只针对于菜鸟级的)

    自己开始接触vss 的时候有些小的习惯没有很好的养成,下面的有关VSS内容都是简单的迁入迁出的问题,(仅供参考) 1.文件的迁入迁出:(.txt..xlsx..doc) a:文件的覆盖问题: 对于文件 ...

  10. VC printf输出彩色字体

    在VC下使用SetConsoleTextAttribute()函数可以改变当前控制台的前景色和背景色,从而达到输出彩色字体的效果. 使用的方法也很简单,具体代码如下: #include <win ...