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. 使用navicat连接 mysql时出现client does not support auth...upgrading Mysql Client

    问题报错:使用navicat时发现出现如下情况: 原因:发现是由于navicat版本的问题,出现连接失败的原因:mysql8 之前的版本中加密规则是mysql_native_password,而在my ...

  2. Django搭建博客文章---模型层

    页面展示所需字段 1.文章标题---文本类型 2.文章摘要---文本类型 3.文章内容--文本类型 4.唯一的ID标记---int数字类型(自增.主键) 5.发布日期--日期类型 模型层定义字段 1. ...

  3. debian9安装mysql

    cd /tmp wget https://dev.mysql.com/get/mysql-apt-config_0.8.7-1_all.deb dpkg -i mysql-apt-config_*.d ...

  4. python is, ==区别

    “is” is the identity comparison. #比较引用是否相同 “==” is the equality comparison. #比较内容是否相同 >>> [ ...

  5. Linux系统(和mac系统)chmod修改权限总结

    在 Mac 系统的终端上修改文件权限使用的是 Linux 中的 chmod 命令. chmod 用户+操作+权限+文件 用户部分:使用字母 u 表示文件拥有者(user),g 表示拥有者所在群组(gr ...

  6. css3 @keyframes、transform详解与实例

    一.transform 和@keyframes动画的区别: @keyframes动画是循环的,而transform 只执行一遍. 二.@keyframes CSS3中添加的新属性animation是用 ...

  7. 输入,输出与Mad Libs游戏

    name1=input('请输入一个名字') name2=input('请输入一个名字') car=input('请输入一种车子') print('饥饿的{}看到{}穿着三级甲骑着{}下山'.form ...

  8. vue_小项目_模糊搜索(列表过滤)_结果排序

    html <div id="test"> <label> <input type="text" v-model="sea ...

  9. java实现文章敏感词过滤检测

    SensitivewordFilter.java import java.util.HashSet; import java.util.Iterator; import java.util.Map; ...

  10. archlinux下安装acroread打开pdf

    虽说acroread是个好东西,但是在打开pdf几秒后总是自动退出呢 在其aur网页下找到了这么一解决办法: 打开终端输入 sudo unshare -n sudo -u ${USER} ACRO_A ...