centos 7安装配置vsftpd

yum install -y vsftpd #安装vsftpd

yum install -y psmisc net-tools systemd-devel libdb-devel perl-DBI  #安装vsftpd虚拟用户配置依赖包

systemctl enable vsftpd.service  #设置vsftpd开机启动

cp /etc/vsftpd/vsftpd.conf   /etc/vsftpd/vsftpd.conf-bak #备份默认配置文件

 

 

编辑 /etc/vsftpd/vsftpd.conf 

 

使之成为如下内容

 

 

anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=002
userlist_enable=YES
userlist_deny=yes
userlist_file=/etc/vsftpd/user_list
tcp_wrappers=YES

 

dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES
listen=YES
pam_service_name=vsftpd
tcp_wrappers=YES
banner_file=/etc/vsftpd/welcome.txt
#chroot
chroot_local_user=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd/chroot_list
local_max_rate=1000000
listen_port=21
idle_session_timeout=300
data_connection_timeout=1
guest_enable=YES
guest_username=apps
user_config_dir=/etc/vsftpd/vconf
virtual_use_local_privs=YES

ftp_data_port=10020

pasv_enable=yes
pasv_min_port=10060
pasv_max_port=10090
pasv_addr_resolve=YES
pasv_address=121.201.24.233

accept_timeout=5
connect_timeout=1
allow_writeable_chroot=YES

编辑/etc/vsftpd/welcome.txt 

touch /etc/vsftpd/chroot_list 

vim /etc/vsftpd/virtusers  建立虚拟用户名单

admin

WJ8gqMUbArtIsmGRF9W4

第一行是账号,第二行是密码

用下面的命令生成虚拟用户文件

db_load -T -t hash -f /etc/vsftpd/virtusers /etc/vsftpd/virtusers.db

修改权限为 600

chmod 600 /etc/vsftpd/virtusers.db

在/etc/pam.d/vsftpd的文件头部加入以下信息,一定要加在头部,不能加在其他地方。

vi /etc/pam.d/vsftpd

auth sufficient /lib64/security/pam_userdb.so db=/etc/vsftpd/virtusers

account sufficient /lib64/security/pam_userdb.so db=/etc/vsftpd/virtusers

新建系统用户apps,用户目录为/home/apps

useradd apps -d /home/apps

chown apps:apps /home/apps -R

这里我们用应用本身的账号apps 来代替新建账号

建立虚拟用户个人Vsftp的配置文件

mkdir /etc/vsftpd/vconf

cd /etc/vsftpd/vconf

mkdir -p /home/apps/admin

vi admin #编辑用户web1配置文件,其他的跟这个配置文件类似

local_root=/home/apps/admin

write_enable=YES

anon_world_readable_only=NO

anon_upload_enable=YES

anon_mkdir_write_enable=YES

anon_other_write_enable=YES

重启FTP

systemctl restart vsftpd.service

备注:

guest_username=apps #指定虚拟用户的宿主用户(就是我们前面新建的用户)

guest_username=apps #如果ftp目录是指向网站根目录,用来上传网站程序,可以指定虚拟用户的宿主用户为Tomcat运行账户apps,可以避免很多权限设置问题

转载于:https://www.cnblogs.com/hyming011/p/8086823.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/390493.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

amazeui学习笔记--css(基本样式3)--文字排版Typography

amazeui学习笔记--css(基本样式3)--文字排版Typography 一、总结 1、字体:amaze默认非 衬线字体(sans-serif) 2、引用块blockquote和定义列表:引用块blockquote和定义列表(dl dt)注意…

剑指 Offer 46. 把数字翻译成字符串

给定一个数字,我们按照如下规则把它翻译为字符串:0 翻译成 “a” ,1 翻译成 “b”,……,11 翻译成 “l”,……,25 翻译成 “z”。一个数字可能有多个翻译。请编程实现一个函数,用来计…

Zend Guard 7 , Zend Guard Loader处理PHP加密

环境:使用Zend Guard 7 软件加密。 PHP 5.6 LNMP 一键安装,PHP5.6Zend Guard Loader (对应的版本文件)是已经安装好了,还要安装 opcache.so ,直接在lnmp 安装教程中有。因为自动安装 的 版本并不对应,于…

qr码是二维码码_如何使用QR码进行有效的营销和推广

qr码是二维码码Efficient means doing things right. Effective is about doing the right things.高效意味着做正确的事。 有效就是做正确的事。 I am an advocate for efficiency and effectiveness. There must be a more efficient way to share contact details other th…

ELK学习记录三 :elasticsearch、logstash及kibana的安装与配置(windows)

注意事项: 1.ELK版本要求5.X以上 2.Elasticsearch5.x版本必须基于jdk1.8,安装环境必须使用jdk1.8 3.操作系统windows10作为测试环境,其他环境命令有差异,请注意 4.本教程适合完全离线安装 5.windows版本ELK安装包下载路径&#xf…

【quickhybrid】JSBridge的实现

前言 本文介绍quick hybrid框架的核心JSBridge的实现 由于在最新版本中,已经没有考虑iOS7等低版本,因此在选用方案时没有采用url scheme方式,而是直接基于WKWebView实现 交互原理 具体H5和Native的交互原理可以参考前文的H5和Native交互原理 …

mongodb atlas_如何使用MongoDB Atlas将MERN应用程序部署到Heroku

mongodb atlas简介 (Introduction to MERN) In this article, well be building and deploying an application built with the MERN stack to Heroku.在本文中,我们将构建和部署使用MERN堆栈构建的应用程序到Heroku。 MERN, which stands for MongoDB, Express, R…

面试题 10.02. 变位词组

编写一种方法,对字符串数组进行排序,将所有变位词组合在一起。变位词是指字母相同,但排列不同的字符串。 注意:本题相对原题稍作修改 示例: 输入: [“eat”, “tea”, “tan”, “ate”, “nat”, “bat”], 输出: [ [“ate”,…

智能合约设计模式

2019独角兽企业重金招聘Python工程师标准>>> 设计模式是许多开发场景中的首选解决方案,本文将介绍五种经典的智能合约设计模式并给出以太坊solidity实现代码:自毁合约、工厂合约、名称注册表、映射表迭代器和提款模式。 1、自毁合约 合约自毁…

如何使用1Password,Authy和Privacy.com外包您的在线安全性

Take some work off your plate while beefing up security with three changes you can make today.通过今天可以进行的三项更改来增强安全性,同时省下一些工作。 Unstable times are insecure times, and we’ve already got enough going on to deal with. When…

「CodePlus 2017 12 月赛」火锅盛宴

n<100000种食物&#xff0c;给每个食物煮熟时间&#xff0c;有q<500000个操作&#xff1a;在某时刻插入某个食物&#xff1b;查询熟食中编号最小的并删除之&#xff1b;查询是否有编号为id的食物&#xff0c;如果有查询是否有编号为id的熟食&#xff0c;如果有熟食删除之…

5815. 扣分后的最大得分

给你一个 m x n 的整数矩阵 points &#xff08;下标从 0 开始&#xff09;。一开始你的得分为 0 &#xff0c;你想最大化从矩阵中得到的分数。 你的得分方式为&#xff1a;每一行 中选取一个格子&#xff0c;选中坐标为 (r, c) 的格子会给你的总得分 增加 points[r][c] 。 然…

您有一个上云锦囊尚未领取!

前期&#xff0c;我们通过文章《确认过眼神&#xff1f;上云之路需要遇上对的人&#xff01;》向大家详细介绍了阿里云咨询与设计场景下的五款专家服务产品&#xff0c;企业可以通过这些专家服务产品解决了上云前的痛点。那么&#xff0c;当完成上云前的可行性评估与方案设计后…

怎么从运营转到前端开发_我如何在16个月内从销售人员转到前端开发人员

怎么从运营转到前端开发On August 18, 2015, I was on a one-way flight headed to Copenhagen from Toronto Pearson Airport. I was starting my two semester exchange at the Copenhagen Business school. 2015年8月18日&#xff0c;我乘坐单程飞机从多伦多皮尔逊机场前往哥…

Python os.chdir() 方法

概述 os.chdir() 方法用于改变当前工作目录到指定的路径。 语法 chdir()方法语法格式如下&#xff1a; os.chdir(path) 参数 path -- 要切换到的新路径。 返回值 如果允许访问返回 True , 否则返回False。 实例 以下实例演示了 chdir() 方法的使用&#xff1a; #!/usr/bin/pyth…

oracle认证考试_Oracle云认证–通过此3小时免费课程通过考试

oracle认证考试This Oracle Cloud Certification exam will take – on average – about one week of study to prepare for. Most people who seriously commit to their studies are ready to pass the exam within about four days.这项Oracle Cloud认证考试平均需要大约一…

git 修改远程仓库源

自己已经写好了一个项目&#xff0c;想上传到 github github 创建新项目 新建 README.md &#xff0c; LICENSE 本地项目添加 github 远程仓库源 不是git项目git remote add origin https://USERNAME:PASSWORDgithub.com/USERNAME/pro.git已是git项目&#xff0c;先删除再添加 …

Docker 常用命令备忘录

build镜像docker build -t"name" . 复制代码后台运行docker run -d -i -t 14a21c118315 /bin/bash 复制代码删除镜像docker image rmi -f 300de37c15f9 复制代码停止运行的镜像docker ps docker kill (id) 复制代码进入镜像docker attach 29f2ab8e517c(ps id) 复制…

mvp最小可行产品_最低可行产品–如何为您的项目建立MVP以及为什么要这样做

mvp最小可行产品具有足够功能的产品可以收集全面的定性反馈 (A product with just enough features to gather comprehensive qualitative feedback) Proof of concept, prototypes, wireframes, mockups… what actually constitutes a Minimum Viable Product (MVP)?概念验证…

composer 更改为中国镜像

composer 更改为中国镜像 $ composer config -g repo.packagist composer https://packagist.phpcomposer.com 转载于:https://www.cnblogs.com/love-snow/articles/8111410.html