Setup FTP Server on CentOS 7

Install vsftpd

vsftpd (Very Secure File Transport Protocol Daemon) is a secure, fast FTP server for Unix/Linux systems.

# install vsftp
yum install vsftpd -y #edit config file and
## disable anonymous login : change YES to NO
## uncomment ascii_upload_enable=YES and ascii_download_enable=YES
## Uncomment - Enter your Welcome message - This is optional ##
# ftpd_banner=Welcome to UNIXMEN FTP service. vim /etc/vsftpd/vsftpd.conf ## Add at the end of this  file ##
use_localtime=YES
#change to NO for listen_ipv6
listen_ipv6=NO
#change to YES for listen
listen=YES

#Following part is very important!!!

pasv_enable=YES
pasv_min_port=5000
pasv_max_port=6000
pasv_address=xxx.xxx.xxx.xxx  #public IP goes here

#optional
listen_port=2121
#Enable and start the vsftpd service: systemctl enable vsftpd systemctl start vsftpd

Add new User and set password

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

useradd sk
passwd sk

> ftp 192.168.1.101

Errors and solutions:

1. vsftpd 425 Security: Bad IP connecting

主要是需要在/etc/vsftpd/vsftpd.conf文件中添加如下一行: pasv_promiscuous=YES

然后重启: systemctl restart vsftpd 解决问题

2、ftp中使用get后,文件位于本地哪里: 命令: lcd   或者指定目录 lcd /home/myfolder/testfolder

3、报“use PORT or PASV first.”, 需要使用命令:  quote pasv 或者quote port来切换。

4、关于zip/unzip,请访问 http://www.cnblogs.com/swlin/p/PHP.html

Set folder of ftp for user

Simple way:

https://unix.stackexchange.com/questions/94603/limit-ftp-access-only-to-the-var-www-with-vsftpd

Method 1: change user home default directory

Make sure following line exists:

chroot_local_user=YES

Set user HOME Directory to /var/www/ , if you want to change for existing user then you can use:

usermod --home /var/www/ username

then set required permission on /var/www/

Method 2: Use user_sub_tokenIf you don't want to change user's Home directory then you can use:

chroot_local_user=YES
local_root=/ftphome/$USER
user_sub_token=$USER

About user_sub_token

Automatically generate a home directory for each virtual user, based on a template. For example, if the home directory of the real user specified via guest_username is /ftphome/$USER, and user_sub_token is set to $USER, then when virtual user test logs in, he will end up (usually chroot()'ed) in the directory /ftphome/test. This option also takes affect if local_root contains user_sub_token.

Advanced way

http://askubuntu.com/questions/575523/how-to-setup-virtual-users-for-vsftpd-with-access-to-a-specific-sub-directory  (TO BE READ)

https://superuser.com/questions/269882/can-i-upload-an-entire-folder-using-ftp (TO BE READ)

How to remove systemd services

My recipe for service obliteration (be careful with the rm statements!)

systemctl stop [servicename]
systemctl disable [servicename]
rm /etc/systemd/system/[servicename]
rm /etc/systemd/system/[servicename] symlinks that might be related
systemctl daemon-reload
systemctl reset-failed

  

Reference

https://www.unixmen.com/install-configure-ftp-server-centos-7/

http://www.cnblogs.com/hhuai/archive/2011/02/12/1952647.html

FTP Commands:https://www.cs.colostate.edu/helpdocs/ftp.html

FTP Config: http://vsftpd.beasts.org/vsftpd_conf.html

setup FTP server on CentOS 7的更多相关文章

  1. Setup FTP Server On CentOS, RHEL, Scientific Linux 6.5/6.4/6.3

    setsebool allow_ftpd_full_access onsetsebool -P ftp_home_dir on vsftpd (Very Secure File Transport P ...

  2. Setup FTP server on Ubuntu 14.04

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

  3. 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 ...

  4. Ubuntu setup ftp server.

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

  5. 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 ...

  6. centos 安装FTP server详情(转)

    centos 安装FTP server详情 分类: linux 2013-12-27 16:45 227人阅读 评论(0) 收藏 举报 我们这里以安装vsftpd 服务器端为例子: 1.进入到cent ...

  7. Centos下ftp协议连接远程ftp server主机

    环境说明 [root@Check3 ~]# cat /etc/redhat-release CentOS release 6.9 (Final) [root@Check3 ~]# uname -a L ...

  8. Setup and Configure the vsftpd server in CentOS 7 operation system

    ############################################################################## 1. close the firewall ...

  9. How to set up an FTP server on Ubuntu 14.04

    How to set up an FTP server on Ubuntu 14.04 Setting up a fully-functional and highly secure FTP serv ...

随机推荐

  1. Exceptionless 生产部署笔记

    参考 部署用于生产的Exceptionlees(一个强大易用的日志收集服务) 1. 安装配置 redis 4.0  点击下载redis教学脑图 cd /opt wget http://download ...

  2. Kafka(二)CentOS7.5搭建Kafka2.11-1.1.0集群与简单测试

    一.下载 下载地址: http://kafka.apache.org/downloads.html    我这里下载的是Scala 2.11对应的 kafka_2.11-1.1.0.tgz 二.kaf ...

  3. numpy的基础运算2-【老鱼学numpy】

    numpy的基础运算中还有很多运算,我们这里再记录一些. 最小/大值索引 前面一篇博文中我们讲述过如何获得数组中的最小值,这里我们获得最小/大值的索引值,也就是这个最小/大值在整个数组中位于第几位. ...

  4. F#周报2019年第11期

    新闻 Bolero:WebAssembly中的F# 尝试WebAssembly里的F# JetBrains的fsharp-support 2019.1 ML.NET 0.11发布 Outreachy内 ...

  5. 转载:使用Tornado+Redis维护ADSL拨号服务器代理池

    我们尝试维护过一个免费的代理池,但是代理池效果用过就知道了,毕竟里面有大量免费代理,虽然这些代理是可用的,但是既然我们能刷到这个免费代理,别人也能呀,所以就导致这个代理同时被很多人使用来抓取网站,所以 ...

  6. XIII Open Grodno SU Championship

    A. Alice in the Wonderland 按题意模拟. #include<stdio.h> #include<iostream> #include<strin ...

  7. 2017 CCPC Qinhuangdao Site

    A. Balloon Robot 假设机器人$0$时刻位于$0$号位置,那么每个气球所需的时间为$(s_a-b)\bmod m$. 将所有气球按这个时间排序,枚举每个气球的时间作为偏移量,得出最优解即 ...

  8. php获取文章的第一张图片

    今天做东西的时候遇到一个问题就是如何把文章提取出来作为文章列表呢? 因为用了Ueditor,所以提交的数据包含了html标签. 搜索了一会找到了一个方案,用php自带的函数去掉了html标签. $ar ...

  9. __x__(38)0909第五天__雪碧图的制作

    1. 用ps打开目标图片若干. 2. 调整合适的画布大小. 3. 将图片拖曳到一张里. 4. 存储为Web所用格式,选择 png24 .

  10. Go数组求和

    package main import "fmt" ]int func main() { a := [],,,,} var b int for index,value := ran ...