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. Device Tree常用方法解析

    Device Tree常用方法解析 Device Tree在Linux内核驱动中的使用源于2011年3月17日Linus Torvalds在ARM Linux邮件列表中的一封邮件,他宣称“this w ...

  2. 【解决】小米M1刷机教程(卡刷)

    1.下载合适的rom 下载地址为:http://rom.xiaomi.cn/ 选择合适的机型.硬件版本.固件类.软件版本后,点击“搜索”后,下载合适版本即可. 2.备份 个人手机主要需要备份的项目如下 ...

  3. 使用Pig预测电信用户的移动路径

    实战数据: 预期结果: 测试数据: 002|2014-09-10 00-09|东油大学 002|2014-09-10 09-17|学苑小区 001|2014-09-12 00-09|东油大学 001| ...

  4. 1116 HTML CSS

    1. JPEG和GIF在使用时的注意事项: JPEG可以连续调次(复制品中有中间层次,如照片)图像中获得最好效果:JPEG可以用1600万色显示图像,是有损格式,不支持透明. GIF适用于几种纯色组成 ...

  5. 浏览器兼容console对象的简要解决方案

    不同浏览器或者版本之间对于console对象的支持不尽相同,而console方法在开发调试过程中都是不错的工具.难道要在上线前把所有console.xxxx去掉以保证某些浏览器不报错么.其实可以变通解 ...

  6. Spring基于注解的Cache支持

    Spring为我们提供了几个注解来支持Spring Cache.其核心主要是@Cacheable和@CacheEvict.使用@Cacheable标记的方法在执行后Spring Cache将缓存其返回 ...

  7. DDoS deflate - Linux下防御/减轻DDOS攻击

    2010年04月19日 上午 | 作者:VPS侦探 前言 互联网如同现实社会一样充满钩心斗角,网站被DDOS也成为站长最头疼的事.在没有硬防的情况下,寻找软件代替是最直接的方法,比如用iptables ...

  8. ListView 选择多项目返回的之前的那项

      当ListView多选时返回第一次选中的项索引 正确 定义一个变量 =-1 表示第一次没选任何一项   private int FirstSelectedIndex =-1;     更新Firs ...

  9. linux系统编程:进程间通信-mmap

    进程间通信-mmap #include <sys/mman.h> void *mmap(void *addr, size_t length, int prot, int flags, in ...

  10. 利用京东云擎架设免费Wordpress 博客(git方式)

    京东云擎(JAE)是京东推出的一款公有云产品,是京东云平台生态圈的核心组成部分.与百度的BAE.新浪的SAE同样.可是JAE刚上线不久,可能非常多人都还没听说过或不太了解.我尝试在JAE安装WordP ...