0.vsftpd与ftp安装

yum install -y vsftpd ftp

1.vsftpd 服务启停相关命令

systemctl start vsftpd
systemctl stop vsftpd
systemctl restart vsftpd
systemctl status vsftpd

2.配置文件/etc/vsftpd/vsftpd.conf相关配置选项

# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
anonymous_enable=NO
#
# Uncomment this to allow local users to log in.
# When SELinux is enforcing check for SE bool ftp_home_dir
local_enable=YES
#
# Uncomment this to enable any form of FTP write command.
write_enable=YES
# Activate directory messages - messages given to remote users when they
# go into a certain directory.
dirmessage_enable=YES
# You may change the default value for timing out an idle session.
idle_session_timeout=
# You may specify an explicit list of local users to chroot() to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot().
# (Warning! chroot'ing can be very dangerous. If using chroot, make sure that
# the user does not have write access to the top level directory within the
# chroot)
chroot_local_user=YES
allow_writeable_chroot=YES pam_service_name=vsftpd
# Set to NO if you want to disallow the PASV method of obtaining a data
# connection.
#
pasv_enable=YES
pasv_max_port=
pasv_min_port= max_clients=
max_per_ip=

  a.如果allow_writeable_chroot为NO,ftp登录时出现以下错误。

 OOPS: vsftpd: refusing to run with writable root inside chroot()
Login failed.
Service not available, remote server has closed connection

3. sestatus -b|grep ftp查看SELinux相关boolean变量,setsebool修改相关变量,修改结果如下示:

ftpd_anon_write                             off
ftpd_connect_all_unreserved off
ftpd_connect_db off
ftpd_full_access on
ftpd_use_cifs off
ftpd_use_fusefs off
ftpd_use_nfs off
ftpd_use_passive_mode off
httpd_can_connect_ftp off
httpd_enable_ftp_server off
tftp_anon_write off
tftp_home_dir off

  a.如果ftpd_full_access为off,ftp登录时将出现以下错误。

 OOPS: chroot
Login failed.
Service not available, remote server has closed connection

4.创建仅供ftp登录(不允许ssh)的用户ftpuser

  a.查看nologin:

whereis nologin

  b.创建用户ftpuser:

useradd -d /home/ftpuser -m -s /usr/sbin/nologin ftpuser

  c.设置ftpuser密码:

passwd ftpuser

5. firewall-config GUI防火墙配置中开启ftp服务,或firewall-cmd 命令行开启ftp服务

a.firewall-config开启服务

b.firewall-cmd开启服务

//开启ftp服务
firewall-cmd --add-service=ftp
//列出服务列表
firewall-cmd --list-services

参考:

1.vsftpd 配置:chroot_local_user与chroot_list_enable详解

2.Install and Configure VSFTPD / SFTP on CentOS 7

3.关于ftp的选择:vsftpd 和proftpd

4.Install and configure FTP server in Redhat/Centos Linux

5.FTP主动模式和被动模式的区别

RedHatEnterpriseLinuxServerRelease7.3上配置vsftp服务器的更多相关文章

  1. RedHatEnterpriseLinuxServerRelease7.3上配置vsftpd服务器

    0.vsftpd与ftp安装 yum install -y vsftpd ftp 1.vsftpd 服务启停相关命令 systemctl start vsftpd systemctl stop vsf ...

  2. asp.net core 简单部署之FTP配置(CentOS 7.0安装配置Vsftp服务器)

    配置过程原文地址:http://www.osyunwei.com/archives/9006.html 坑和结果 正确的跟着这个内容走,是靠谱的. 我自己给自己踩了个坑,请参照文章的朋友注意第七条:七 ...

  3. CentOS 7.0安装配置Vsftp服务器

    一.配置防火墙,开启FTP服务器需要的端口 CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙. 1.关闭firewall: systemctl stop fi ...

  4. 配置VSFTP服务器

    一.Linux FTP服务器分类:  <1>wu-ftp  <2>proftp=profession ftp  <3>vsftp=very security ftp ...

  5. CentOS 7.0安装配置Vsftp服务器步骤详解

    安装Vsftp讲过最多的就是在centos6.x版本中了,这里小编看到有朋友写了一篇非常不错的CentOS 7.0安装配置Vsftp服务器教程,下面整理分享给各位. 一.配置防火墙,开启FTP服务器需 ...

  6. 【转发】【linux】【ftp】CentOS 7.0安装配置Vsftp服务器

    adduser -d /var/www/android -g ftp -s /sbin/nologin ftp2 一.配置防火墙,开启FTP服务器需要的端口 CentOS 7.0默认使用的是firew ...

  7. CentOS 7.2安装配置Vsftp服务器

    一.配置防火墙,开启FTP服务器需要的端口 CentOS 7.2默认使用的是firewall作为防火墙,这里改为iptables防火墙. 1.关闭firewall: systemctl stop fi ...

  8. CenOS配置VSFTP服务器

    1 Linux FTP服务器分类: wu-ftp proftp=profession ftp vsftp=very security ftp 2 安装vsftp yum install vsftp 3 ...

  9. 在windwo server2008服务器上配置ftp服务器、及配置phpstrom工具、实现项目同步。

    在windwo server2008服务器上配置ftp服务器.及配置phpstrom工具.实现项目同步. 在windwo server2008服务器上配置ftp服务器 参考该篇文章:http://bl ...

随机推荐

  1. Python之函数的进阶(带参数的装饰器)

    函数篇--装饰器二 带参数的装饰器 def outer(flag): def timer(func): def inner(*args,**kwargs): if flag: print('''执行函 ...

  2. maven环境变量的配置及+eclipse的配置使用

    1. 环境搭建(Maven+eclipse) 进入CMD 输入: mvn  –v   查看是否配置好 输入: mvn  -version 可以查看其安装的版本 在eclipse中配置maven: 在h ...

  3. Scrapy抓取Quotes to Scrape

    # 爬虫主程序quotes.py # -*- coding: utf-8 -*- import scrapy from quotetutorial.items import QuoteItem # 启 ...

  4. jquery楼层效果

  5. if else if,switch case二者的联系与区别

    前段时间在学习中听到了一个关于条件判断语句的问题,分析if else if语句和switch case语句这两者之间的联系和区别,从而使用其中最有效率的一种方法. 一.if...else if if. ...

  6. TCP/IP学习笔记(二):TCP连接的建立与终止

    TCP连接的三次握手: (1)请求短发送一个SYN段指明客户打算连接的服务器的端口,以及初始序号ISN(1415535521),报文段中SYN=1:TCP规定:SYN报文段不能携带数据,但是要消耗一个 ...

  7. [LeetCode] Prime Number of Set Bits in Binary Representation 二进制表示中的非零位个数为质数

    Given two integers L and R, find the count of numbers in the range [L, R] (inclusive) having a prime ...

  8. [LeetCode] Maximum Average Subarray I 子数组的最大平均值

    Given an array consisting of n integers, find the contiguous subarray of given length k that has the ...

  9. Mysql之单表记录查询

    数据记录查询: 1.简单数据记录查询: select * from table_name; select allfield from table_name; select distinct(属性名) ...

  10. vba打开输入文件

    Sub fileCreate2() Dim folderPath, fileName, s As String Dim fs, fo, fc, f As Object folderPath = &qu ...