惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - Donal

docker命令 NLP | 自然语言处理 - 语言模型(Language Modeling) windows: Python安装scipy,scikit-image时提示"no lapack/blas resources found"的解决方法 Sense2vec with spaCy and Gensim python 去停用词 nohup command > myout.file 2>&1 & NLTK vs SKLearn vs Gensim vs TextBlob vs spaCy Gensim进阶教程:训练word2vec与doc2vec模型 Gensim入门教程 使用pdb调试python git只clone仓库中指定子目录 转:深度学习与自然语言处理之五:从RNN到LSTM 转:如何构建爬虫代理服务? RHEL7下安装使用TensorFlow和kcws 解决windows10搜索不到内容的问题 forward和redirect 的区别 RHEL7磁盘分区挂载和格式化 Spring注解 100 open source Big Data architecture papers for data professionals
RHEL7 -- Linux搭建FTP虚拟用户
Donal · 2016-07-14 · via 博客园 - Donal

安装vsftpd软件包
[root@localhost ~]# yum install vsftpd -y
[root@localhost ~]# yum install db4 db4-utils

建立vsftpd服务的宿主用户
[root@localhost ~]# useradd vir -s /sbin/nologin

创建日志文件
[root@localhost ~]# touch /var/log/vsftpd.log
[root@localhost ~]# chown vir:vir /var/log/vsftpd.log

修改 vsftp 配置文件
[root@localhost ~]# vi /etc/vsftpd/vsftpd.conf
#不允许匿名访问
anonymous_enable=NO
#本地用户可以访问
local_enable=YES
#使用户不能离开主目录
chroot_list_enable=YES
#允许上传
ascii_upload_enable=YES
#支持ASCII模式的下载功能
ascii_download_enable=YES
#千万别忘记添加
pam_service_name=vsftpd

#手工输入以下参数和值
#开启虚拟用户的功能
guest_enable=YES
#指定虚拟用户的宿主用户
guest_username=vir
user_config_dir=/etc/vsftpd/vuser_conf
#vsftpd的服务日志保存路径,默认不存在
xferlog_file=/var/log/vsftpd.log

先建立虚拟用户名单文件
[root@localhost ~]# vi /etc/vsftpd/vsftp_users.conf
#输入奇数行为账号,偶数行为密码
yb1 #账号
abcd1234 #密码
yb2
abcd1234

生成认证文件
db_load 找不到的话就先安装 db4-utils(yum install db4 db4-utils)
[root@localhost ~]# db_load -T -t hash -f /etc/vsftpd/vsftp_users.conf /etc/vsftpd/vsftp_users.db
修改其权限
[root@localhost ~]# chmod 600 /etc/vsftpd/vsftp_users.db

编辑认证文件,清空或注释文件中全部内容(保留第一行内容)
[root@localhost ~]# vi /etc/pam.d/vsftpd
清空之后,再输
auth required pam_userdb.so db=/etc/vsftpd/vsftp_users
account required pam_userdb.so db=/etc/vsftpd/vsftp_users

建立虚拟用户配置文件存放位置
[root@localhost ~]# mkdir /etc/vsftpd/vuser_conf/

自定义用户(可以分别设置不同虚拟用户权限等)
[root@localhost ~]# vi /etc/vsftpd/vuser_conf/yb1

添加以下内容
local_root=/data01/yb1 #虚拟用户yb2根目录
write_enable=YES
anon_umask=022
anon_world_readable_only=NO
anon_upload_enable=YES
anon_mkdir_write_enable=YES
anon_other_write_enable=YES

[root@localhost ~]# vi /etc/vsftpd/vuser_conf/yb2

添加以下内容
local_root=/data01/yb2 #虚拟用户yb2根目录
write_enable=YES
anon_umask=022
anon_world_readable_only=NO
anon_upload_enable=YES
anon_mkdir_write_enable=YES
anon_other_write_enable=YES

OK了,启动或重启 vsftp
[root@localhost ~]# systemctl vsftpd restart(重启 restart)


连接 FTP 时若提示错误:vsftpd 530 login incorrect
原因:/etc/vsftpd.conf参数配置里面有空格
解决方法:去掉空格


连接 FTP 时若提示错误:500 OOPS: vsftpd: refusing to run with writable root inside chroot()
原因:vsftpd的安全规则是不允许ftp用户对ftp根目录有可写权限,因此那个ftp用户就被服务器拒绝了。
解决方法:
chmod a-w /data01/yb1
chmod a-w /data01/yb2