centos7的vsftpd的安装和配置
安装vsftpd的服务器相关软件
安装vsftpd服务器和客户端
sudo yum install ftp vsftpd安装一个加密工具
sudo yum install libdb-utils.x86_64
配置vsftpd
- 创建vsftpd的登录用户和主目录
sudo useradd -d /home/myftp -s /sbin/nologin myftp(myftp是ftp的登录用户,替换成你自己的用户) - 修改相应的密码
passwd myftp, - 创建vsftpd虚拟用户
sudo touch /etc/vsftpd/vftpuser.txt
myftp
myftp 密码
用户2
用户2密码
......
sudo db_load -T -t hash -f /etc/vsftpd/vftpuser.txt /etc/vsftpd/vftpuser.db
4. 添加vsftpd的虚拟用户的验证
sudo vim /etc/pam.d/vsftpd
把account和auth替换了
session optional pam_keyinit.so force revoke
#auth required pam_listfile.so item=user sense=deny file=/etc/vsftpd/ftpusers onerr=succeed
#auth required pam_shells.so
#auth include password-auth
#account include password-auth
auth required pam_userdb.so db=/etc/vsftpd/vftpuser
account required pam_userdb.so db=/etc/vsftpd/vftpuser
session required pam_loginuid.so
session include password-auth
- 修改vsftpd的配置文件vsftpd.conf
sudo vim /etc/vsftpd/vsftpd.conf
下面的文件删除了注释
# 是否运行匿名登录(NO)
anonymous_enable=NO
# 是否允许本地用户登录
local_enable=YES
# 允许ftp的任何写方式
write_enable=YES
# 文件创建只有的权限是755=(777-022)
local_umask=022
# 是否允许匿名用户上传文件
#anon_upload_enable=YES
# 是否允许匿名用户创建文件或者删除文件
#anon_mkdir_write_enable=YES
# 用户进入目录信息提示
dirmessage_enable=YES
# 是否允许vsftp的日志
xferlog_enable=YES
# Make sure PORT transfer connections originate from port 20 (ftp-data).
connect_from_port_20=YES
#
#chown_uploads=YES
#chown_username=whoever
# 日志文件的路径
xferlog_file=/var/log/xferlog
# 日志文件的格式
xferlog_std_format=YES
#
#idle_session_timeout=600
#
#data_connection_timeout=120
#
# It is recommended that you define on your system a unique user which the
# ftp server can use as a totally isolated and unprivileged user.
#nopriv_user=ftpsecure
#
# Enable this and the server will recognise asynchronous ABOR requests. Not
# recommended for security (the code is non-trivial). Not enabling it,
# however, may confuse older FTP clients.
#async_abor_enable=YES
#
# By default the server will pretend to allow ASCII mode but in fact ignore
# the request. Turn on the below options to have the server actually do ASCII
# mangling on files when in ASCII mode.
# Beware that on some FTP servers, ASCII support allows a denial of service
# attack (DoS) via the command "SIZE /big/file" in ASCII mode. vsftpd
# predicted this attack and has always been safe, reporting the size of the
# raw file.
# ASCII mangling is a horrible feature of the protocol.
#ascii_upload_enable=YES
#ascii_download_enable=YES
#
# You may fully customise the login banner string:
#ftpd_banner=Welcome to blah FTP service.
#
# You may specify a file of disallowed anonymous e-mail addresses. Apparently
# useful for combatting certain DoS attacks.
#deny_email_enable=YES
# (default follows)
#banned_email_file=/etc/vsftpd/banned_emails
#
# 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
chroot_list_enable=YES
# (default follows)
#chroot_list_file=/etc/vsftpd/chroot_list
#
# You may activate the "-R" option to the builtin ls. This is disabled by
# default to avoid remote users being able to cause excessive I/O on large
# sites. However, some broken FTP clients such as "ncftp" and "mirror" assume
# the presence of the "-R" option, so there is a strong case for enabling it.
#ls_recurse_enable=YES
#
# When "listen" directive is enabled, vsftpd runs in standalone mode and
# listens on IPv4 sockets. This directive cannot be used in conjunction
# with the listen_ipv6 directive.
# 只监听ipv4的地址
listen=YES
#
# This directive enables listening on IPv6 sockets. By default, listening
# on the IPv6 "any" address (::) will accept connections from both IPv6
# and IPv4 clients. It is not necessary to listen on *both* IPv4 and IPv6
# sockets. If you want that (perhaps because you want to listen on specific
# addresses) then you must run two copies of vsftpd with two configuration
# files.
# Make sure, that one of the listen options is commented !!
#listen_ipv6=YES
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
# 下面是自己添加的
anon_root=/home/pageftp/open
virtual_use_local_privs=YES
guest_enable=YES
guest_username=pageftp
# 虚拟用户的配置文件(可以对每一个虚拟用户进行单独的权限配置)
user_config_dir=/etc/vsftpd/vconf/
chroot_local_user=YES
allow_writeable_chroot=YES
- 创建虚拟用户的权限配置
sudo mkdir /etc/vsftpd/vconf/
touch 用户1 用户2 ……
vim 用户1
cmds_allowed=ABOR,ACCT,APPE,CWD,CDUP,DELE,HELP,LIST,MODE,MDTM,MKD,NOOP,NLST,PASS,PASV,PORT,PWD,QUIT,REIN,RETR,RMD,RNFR,RNTO,SITE,SIZE
,STOR,STAT,STOU,STRU,SYST,TYPE,USER
write_enable=yes
download_enable=yes
anon_upload_enable=yes
anon_mkdir_write_enable=yes
anon_other_write_enable=yes
anon_world_readable_only=no
- 启动vsftpd服务
sudo systemctl enable vsftpd
sudo service vsftpd start
centos7的vsftpd的安装和配置的更多相关文章
- Centos7 下的SVN安装与配置
Centos7 下的SVN安装与配置 1.关闭防火墙 临时关闭防火墙 systemctl stop firewalld 永久防火墙开机自关闭 systemctl disable firewalld 临 ...
- Centos7上HBase的安装和配置
注意事项 HBase配置必须使用主机名,不支持直接配置IP地址.我尝试过,如果不使用主机名直接用IP,会导致HBase连接zk超时. > 设置主机名 hostnamectl set-hostna ...
- centos7系统下nginx安装并配置开机自启动操作
准备工作 我的centos7系统是最小化安装的, 缺很多库, 首先安装必须的运行库 ? 1 2 3 4 5 6 7 8 9 10 11 yum install wget gcc gcc-c++ pcr ...
- CentOS7下NFS服务安装及配置固定端口
CentOS7下NFS服务安装及配置 系统环境:CentOS Linux release 7.4.1708 (Core) 3.10.0-693.el7.x86_64 软件版本:nfs-utils-1. ...
- linux下vsftpd的安装及配置使用详细步骤(推荐)
vsftpd 是“very secure FTP daemon”的缩写,安全性是它的一个最大的特点. vsftpd 是一个 UNIX 类操作系统上运行的服务器的名字,它可以运行在诸如 Linux.BS ...
- vsftpd服务安装,配置,限制目录
一.下载版本:vsftpd-2.0.5-16.el5_4.1.i386.rpm 二.安装:rpm -ivh vsftpd-2.0.5-16.el5_4.1.i386.rpm 三.配置: vsftpd. ...
- CentOS 6.5系统使用yum方式安装LAMP环境和phpMyAdmin,mysql8.0.1/mysql5.7.22+centos7,windows mysql安装、配置
介绍如何在CentOs6.2下面使用YUM配置安装LAMP环境,一些兄弟也很喜欢使用编译的安装方法,个人觉得如果不是对服务器做定制,用yum安装稳定简单,何必去download&make&am ...
- Ubuntu 14.04 FTP服务器--vsftpd的安装和配置
更新源列表 打开"终端窗口",输入"sudo apt-get update"-->回车-->"输入当前登录用户的管理员密码"-- ...
- Centos7 中Nginx的安装与配置
安装与配置 1.安装nginx yum intsall nginxsudo systemctl start nginx 启动服务sudo firewall-cmd --permanent --zone ...
随机推荐
- 【requirejs】JS模块化工具requirejs教程
初识requirejs 随着网站功能逐渐丰富,网页中的js也变得越来越复杂和臃肿,原有通过script标签来导入一个个的js文件这种方式已经不能满足现在互联网开发模式,我们需要团队协作.模块复用.单元 ...
- mysql 安装(压缩包安装和exe安装)
1:mysql官网:https://dev.mysql.com/downloads/file/?id=482487 2:压缩包安装:https://www.cnblogs.com/jamespan23 ...
- bzoj1089严格n元树
题目:https://www.lydsy.com/JudgeOnline/problem.php?id=1089 这是一种套路:记录“深度为 i ”的话,转移需要讨论许多情况:所以可以记录成“深度&l ...
- CSS基本样式简单介绍
具体详情内容请查阅<css参考手册> 一.基本结构样式 width 宽度 height 高度 background 背景 border 边框 padding 内边距 margin 外边距 ...
- 快速排序算法-python实现
#-*- coding: UTF-8 -*- import numpy as np def Partition(a, i, j): x = a[i] #将数组的第一个元素作为初始基准位置 p = i ...
- 关于python urlopen 一个类似radio流的timeout方法
终极解决方法来啦!看代码感受: import requests import eventlet import time eventlet.monkey_patch() try: with eventl ...
- Qt学习笔记(1) hello world
Qt的简介: Qt是一个跨平台的C++ GUI库实现,原本只是以为它只提供一些图形接口,看来我还是低估了它,采用文档Qt学习之路2开始学习,不知道这个文档是不是有点老了,管他呢,先了解下. 搭建环境: ...
- C++中如何在顺序容器中删除符合特定条件的元素
以前很少做删除操作,vector一直当成数组用,而实际追求效率时又经常舍弃vector选用C风格数组.看<C++ Primer>到顺序容器删除这节时试着实现课后习题结果一动手我就出错了. ...
- c#实现QQ群成员列表导出及邮件群发之邮件群发
主题已迁移至:http://atiblogs.com/ ITO-神奇的程序员
- python is 和 == 的区别
一.is 和 == 的区别 == 比较 比较的俩边的值 is 比较 比较的是内存地址 id() 二.小数据池 数字小数据池的范围 -5 ~ 256 字符串中如果有特殊字符他们的内存地址就不一样 字符串 ...