This tutorial focuses on how to setup vsftpd server on your linux based VPS or a dedicated server. The vsftpd stands for “Very Secure FTP Daemon”. It is not just secure as the name suggests but also delivers excellent performance by consuming less memory. The tutorial also teaches you how to configure by adding ftp users and locking the directory to individual users.

You can install vsftpd on Ubuntu / Debian, CentOS /Fedora and RHEL linux.

Installing vsftpd on Ubuntu or Debian

sudo apt-get install vsftpd

Installing vsftpd on CentOS / Fedora

yum install vsftpd

How to configure vsftpd:

Now that you’ve installed vsftpd, follow this procedure to configure it. These steps applies for both the linux variants.

Before you get started, stop the vsftpd by typing:

service vsftpd stop

Edit the vsftp.conf

In Ubuntu / Debian:

vi /etc/vsftpd.conf

In Red Hat / CentOS

vi /etc/vsftpd/vsftpd.conf

Make the following changes:

We don’t want anonymous login:

anonymous_enable=NO

Enable local users:

local_enable=YES

The ftpuser should be able to write data:

write_enable=YES

Port 20 need to turned off, makes vsftpd run less privileged:

connect_from_port_20=NO

Chroot everyone:

chroot_local_user=YES

set umask to 022 to make sure that all the files (644) and folders (755) you upload get the proper permissions.

local_umask=022

Now that basic configuration is complete, now let us begin with locking / securing a directory to user.

sudo useradd -d /var/www/path/to/your/dir -s /usr/sbin/nologin ftpuser

Setup a password for the user:

sudo passwd ftpuser

In order to enable the ftpuser read and write the data in your home dir, change the permission and take ownership:

sudo chown -R ftpuser /var/www/path/to/your/dir
sudo chmod 775 /var/www/path/to/your/dir

Create userlist file and add the user:

Ubuntu / Debian:
vi /etc/vsftpd.userlist

CentOS / Fedora

vi /etc/vsftpd/vsftpd.userlist

and add the user:

ftpuser

save the file and open the vsftp.conf file again:

vi /etc/vsftpd.conf

Add the following lines at the end of the file and save it:

# the list of users to give access
userlist_file=/etc/vsftpd.userlist

# this list is on
userlist_enable=YES

# It is not a list of users to deny ftp access
userlist_deny=NO

After completing all these procedures it is almost ready to use it, give it a try but you will get a 500 OOPS permission denied error. To fix it you need to add a nologin to the shell set.

vi /etc/shells

The file should look like this:

/bin/ksh
/usr/bin/rc
/usr/bin/tcsh
/bin/tcsh
/usr/bin/esh
/bin/dash
/bin/bash
/bin/rbash

Add this line at the end:

/usr/sbin/nologin

Now create a usergroup and add the ftpuser to it:

sudo addgroup ftpusers
sudo usermod -Gftpusers ftpuser

Now start the vsftpd:

service vsftpd start

That’s it. Now you have a secure installation of vsftpd on your server.

转载于:https://www.cnblogs.com/MagicLetters/archive/2012/12/25/4382805.html

How to install and configure vsftpd相关推荐

  1. You must use the Role Management Tool to install or configure Microsoft .NET Framework 3.5 SP1

    今天在Windows Server 2008 下安装SQL SERVER 2008时,碰到如下错误: You must use the Role Management Tool to install ...

  2. NFV 2.1安装指南之十 —— Install and Configure vCloud director (VCD)

    @[TOC](NFV 2.1安装指南之十 -- Install and Configure vCloud director (VCD)) 1. Install VCD VCD的安装方式有两种: 基于e ...

  3. How to Install and Configure OpenSSH Server In Linux

    标题:在Linux中安装和配置OpenSSH服务器 Install OpenSSH in Linux  & 在Linux计算机中安装OpenSSH Being a network admini ...

  4. Install And Configure ColdFusion MX 6.1 on Windows

    I've made the case for ColdFusion, but you still need to know how to install it! In this tutorial, I ...

  5. Install and configure iftop

    How to install iftop on Unix/Linux server? The command "iftop" is using for bandwidth (BW) ...

  6. 在Centos8安装 Ansible Tower / Install and Configure Ansible Tower

    在Centos8安装 Ansible Tower 第一步 更新系统 , 添加EPEL库 sudo yum -y update sudo yum -y install epel-release 第二步 ...

  7. How to install and configure NGINX on CentOS 7

    [From:]https://www.godaddy.com/garage/tech/config/how-to-install-and-configure-nginx-on-centos-7/

  8. configure make make install in linux

    这些都是典型的使用GNU的AUTOCONF和AUTOMAKE产生的程序的安装步骤. make 的安装apt-get install make ./configure是用来检测你的安装平台的目标特征的. ...

  9. ./configure make make install 编译安装和卸载 (Linux)

    正常的编译安装/卸载: 源码的安装一般由3个步骤组成:配置(configure).编译(make).安装(make install).   configure文件是一个可执行的脚本文件,它有很多选项, ...

  10. vsftpd+pam+mysql实现ftp构建

    一.安装所需要程序 1.事先安装好开发环境和mysql数据库; 首先配置好yum的server.repo文件 [root@localhost yum.repos.d]# cd [root@localh ...

最新文章

  1. Activity管理(一):activity运行机制
  2. 深入理解分布式技术 - 顺序消费如何才能保证时序性
  3. 鹅厂顶级产品课程:产品细节中的情感化设计
  4. 宝宝树携手网易云信打造母婴咨询沟通新体验
  5. Linux基础-目录与路径
  6. 使用混合云的SQL Server
  7. 请领导批阅文件怎么说_刚到公司,应该怎么喊领导,别直接说名字,高情商这样称呼...
  8. 注释工具_苹果已购丨Notability丨功能强大而简单易用的笔记及PDF注释工具
  9. python array函数_Python 中的range()函数与array()函数
  10. 100万并发连接服务器笔记之测试端就绪
  11. Linux系统:Centos7下搭建ClickHouse列式存储数据库
  12. python密码登录程序三次_Python实现账号密码输错三次即锁定功能简单示例
  13. 多项式拟合缺点_拟合多项式的最小二乘法
  14. 计算机通信基础ppt,计算机网络第2章 数据通信基础知识要点课件.ppt
  15. nmos导通流向_技术参数详解,MOS管知识全录!
  16. 前端学习路线(详细)
  17. Premature optimization is the root of all evil.
  18. dso详解--dso原理
  19. 2017年蓝桥杯C组真题及解析
  20. ARM:NVIC VIC GIC SCB

热门文章

  1. 惠普战66一代拆机_或许这就是匠人吧 全新惠普战66二代的另类拆解
  2. word文档怎么一分为二_word文档转pdf要怎么实现?word转pdf好方法推荐
  3. html中c b和b s,Web开发中B/S架构和C/S架构的区别
  4. 表单修改php参数,php – 使用参数修改symfony表单的url
  5. redis-hmap --go
  6. pythonATM,购物车项目实战_补充1-结构图
  7. 工具篇1-CMDER--windows下工具,模拟linux好用的工具
  8. pythonATM,购物车项目实战2,主函数入口
  9. Windows注销后nginx.exe文件仍能继续运行
  10. java版本号分段比较_java实现的版本号比较