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上配置vsftpd服务器的更多相关文章

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

    1.vsftpd 服务启停相关命令 systemctl start vsftpd systemctl stop vsftpd systemctl restart vsftpd 2.配置文件/etc/v ...

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

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

  3. (转载)在vmware中简单配置vsftpd服务器

    (转载)http://blog.chinaunix.net/uid-7453676-id-2625582.html 分类: LINUX 一 试验的前期环境搭建   系统环境:Fedora 2   软件 ...

  4. 在Linux上配置vsftpd

    一般安装好vsftpd这个服务,它的默认配置文件在这里:/etc/vsftpd/vsftpd.conf 用vim在里面可以添加一些变量控制权限之类的.还有很多chroot相关的东西,里面的变量都有作用 ...

  5. centos7配置vsftpd服务器

    参考网站:https://blog.csdn.net/lianghongge/article/details/78209445 ==================================== ...

  6. 使用postfix在debian上配置邮件服务器

    如果debian中安装了exim4,先卸载exim4: apt-get remove exim4 安装postfix apt-get install postfix 安装完成后就可以测试下,PHP代码 ...

  7. 阿里云上 配置 vsftpd 配置文件 (一个成功例子)

    # # READ THIS: This example file is NOT an exhaustive list of vsftpd options. # Please read the vsft ...

  8. 如何配置vsftpd服务器

    1,通过yum查看本地是否存在vsftpd rpm -qa|grep vsftpd [root@node2 ~]# rpm -qa |grep vsftpdvsftpd-3.0.2-25.el7.x8 ...

  9. 四条命令快速在Ubuntu16.04上配置DNS服务器

    1. apt install dnsmasq -y 2. vim /etc/dnsmasq.d/resolv.conf address=/xxx.yyy.com/21.xx.xx.x 3. servi ...

随机推荐

  1. JavaScript 关闭浏览器窗口

    <input type="button" name="m" value="关闭窗口" onclick="window.clo ...

  2. vue.js 错误提示bash: vue: command not found

    在使用 vue init webpack vue-demo 进行demo的下载时,提示vue: command not found,原因是环境变量没有进行配置,所以会出现这个问题,解决办法 找到你安装 ...

  3. 【[ZJOI2015]诸神眷顾的幻想乡】

    题目 听说这是广义\(SAM\)的板子 看来对于广义\(SAM\)我也就只会板子了 叶子数很少,所以可以枚举每一个叶子节点作为根建一遍\(Trie\)树 只需要对\(Trie\)树建出\(SAM\)就 ...

  4. AJAX(二):HTTP头部信息

    每个http请求和响应都会带有相应都头部信息,其中有的对开发人员有用,有的页没有什么用默认情况下,发送xhr请求的同时,还有发送下列头部信息 Accept:浏览器能够处理的内容类型 Accept-Ch ...

  5. 2017.9.24 JSP动态页面

    1.1 JSP(Java Server Page)是一种运行在服务器端的脚本语言,用来开发动态网页的开发技术. 1.2 JSP页面的结构 JSP页面主要由HTML和JSP代码构成,JSP代码是通过&q ...

  6. aop 和castle 的一些 学习文章

    https://www.cnblogs.com/zhaogaojian/p/8360363.html

  7. AVR446_Linear speed control of stepper motor步进电机曲线分析

    1.1.  单片机代码处理 // 定义定时器预分频,定时器实际时钟频率为:72MHz/(STEPMOTOR_TIMx_PRESCALER+1) #define STEPMOTOR_TIM_PRESCA ...

  8. MAC卸载/删除 Parallels Desktop虚拟机的方法

    一些MAC用户在自己的电脑上安装了虚拟机之后,想要将它卸载,但是不知道该怎么做.今天小编就为大家带来了这个问题的解决方法. 解决方案(删除/卸载虚拟机 (VM): 1.启动Parallels Desk ...

  9. Gtk-Message: Failed to load module “canberra-gtk-module”

    编写wxPython程序时,总是报以下错误: Gtk-Message: Failed to load module “canberra-gtk-module” 解决办法:apt-get install ...

  10. 你不得不掌握的thinkphp5

    thinkphp官网在去年的时候发布了tp的颠覆版本thinkphp5,tp5确实比之前的版本好用了很多,增加了很多的一些特性,它采用全新的架构思想,引入了更多的PHP新特性,优化了核心,减少了依赖, ...