溪明轩

  • Python全栈开发
  • 三溪杂选
  • 爬虫快速入门
  • 首页
  • 文章归档
  • 关于页面

  • 搜索
consul ELK Loki M3DB Thanos TSDB federate ALertmanager PromQL Grafana prometheus nginx Rest Framework 热视图 ansible 网络安全 云盘 wiki Python 爬虫

centos7 FTP简单搭建与常见报错解决

发表于 2019-10-06 | 分类于 项目实例 | 0 | 阅读次数 262

知识共享许可协议
本作品采用知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议进行许可。

安装vsftpd

 yum -y install vsftpd

修改如下内容:

 vi /etc/vsftpd/vsftpd.conf
anonymous_enable=NO #是否允许匿名,默认no
write_enable=YES #具有写权限
local_umask=022 #本地用户创建文件或目录的掩码
connect_from_port_20=YES #开启20端口
listen_port=XXX #ftp的端口号
local_root=/home/wwwroot/sanxi.info/usr/plugins/ #修改为自己想要的指定目录

创建用户,指定用户为系统用户并指定家目录路径

useradd -d /home/wwwroot/sanxi.info/usr/plugins/ -s /sbin/nologin sanxi
passwd sanxi #此处为上述命令所创建之用户
Changing password for user sanxi.
New password:  
passwd: all authentication tokens updated successfully.

启动并设置vsftpd开机启动

systemctl start vsftpd.service
systemctl enable vsftpd.service

报错:
状态: 正在连接 103.72.144.219:21...
状态: 连接建立,等待欢迎消息...
状态: 不安全的服务器,不支持 FTP over TLS。
命令: USER sanxi
响应: 331 Please specify the password.
命令: PASS ********
响应: 500 OOPS: vsftpd: refusing to run with writable root inside chroot()
错误: 严重错误: 无法连接到服务器
状态: 已从服务器断开
解决:
vim /etc/vsftpd.conf add the following
allow_writeable_chroot=YES #
local_root=/home/wwwroot/sanxi.info/usr/plugins/ #修改默认用户家目录为此目录
chroot_local_user=YES #正常密码登录
注释掉listen_ipv6=YES或者改为NO
systemctl restart vsftpd.service

报错:无权限
命令: PASV
响应: 227 Entering Passive Mode (103,72,144,219,163,209).
命令: STOR /Akina/images/smilies/alu/zhoumei.png
响应: 553 Could not create file.
错误: 严重文件传输错误
解决:
chmod -R 777 /home/wwwroot/sanxi.info/usr/plugins/
systemctl restart vsftpd.service

Donate comment here
三溪 微信支付

微信支付

三溪 支付宝

支付宝

  • 本文作者: 三溪
  • 本文链接: https://blog.sanxi.info/archives/centos7ftp简单搭建与常见报错解决
  • 版权声明: 本博客所有文章除特别声明外,均采用CC BY-NC-ND 4.0 许可协议。转载请注明出处!
天津姑娘
再见燕子
  • 文章目录
  • 站点概览
三溪

三溪

作诗不作法

120 日志
23 分类
20 标签
RSS
Creative Commons
Links
  • halo官网
  • 玻璃之空
0%
© 2022 三溪
由 Halo 强力驱动
|
主题 - NexT.Pisces v5.1.4
世间微尘里 独爱茶酒中