Linux(Ubuntu)下使用vsftpd搭建ftp服务器
来源:互联网 发布:软件安全性认识 编辑:程序博客网 时间:2024/05/22 08:00
最近使用一台服务器搭建了nginx服务器,然后把现有系统的静态资源文件放入到这台服务器上,为了方便存放静态文件,使用vsftpd搭建了一个ftp服务器。其中遇到了种种问题,最后一步步解决。
首先,使用命令
sudo apt-get install vsftpd安装vsftpd,安装完成后
sudo vi /etc/vsftpd.conf
配置:listen=YES
listen_ipv6=NO #不监听ipv6
annonymous_enable=NO #不允许匿名登录
local_enable=YES #允许本地登录
write_enable=YES #允许写入
dirmessage_enable=YES #在用户登入到特定路径时给出信息
use_localtime=YES #使用本地时间,如果是NO就会显示GMT
xferlog_enable=YES #在上传下载时做log
connect_from_port_20=YES #
allow_writeable_chroot=YES #允许/etc/vsftpd.chroot_list文件中的用户写入
chroot_local_user=YES #将用户锁定在用户目录中,不允许进入上一层
user_config_dir=/etc/vsftpd_user_config #设置用户的目录,等号后面的路径是自定义的
#后面的五项是默认的设置
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd
rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
ssl_enable=NO
之前有设置路径/etc/vsftpd_user_config,然后在这个路径下新建以用户名为名称的文件,内容为local_root= 等号右边的内容为你想设置的用户的主目录地址。
增加/etc/vsftpd.chroot_list文件,在里面写入你的ftp用户名即可。
修改/etc/pam.d/vsftpd文件,注释掉
auth required pam_shells.so
即在前面加上#符号。不然登录ftp会出现530错误
遇见的错误:
1、 不能将用户限制在其主目录下:方法,在上面的配置中已经给出,就是使用chroot_local_user=YES
2、 增加了chroot_local_user=YES之后,登录出现500,500 OOPS: vsftpd: refusing to run with writable root inside chroot()”,解决方法:增加
allow_writeable_chroot=YES #允许/etc/vsftpd.chroot_list文件中的用户写入
然后增加/etc/vsftpd.chroot_list,在文件中写入用户名,这样就可以用该用户名表明的用户登录
3、 想要更改用户主目录(不受系统用户目录的限制)
user_config_dir=/etc/vsftpd_user_config #设置用户的目录,等号后面的路径是自定义的。
这些错误使用上面的配置方法已经解决了。
- Linux(Ubuntu)下使用vsftpd搭建ftp服务器
- Ubuntu下使用vsftpd搭建FTP服务器
- ubuntu下使用vsftpd搭建ftp服务器
- Ubuntu 下搭建vsftpd(ftp服务器)
- linux下 ftp(vsftpd)服务器搭建
- 在Ubuntu下使用vsftpd搭建FTP服务器
- 在Ubuntu下使用vsftpd搭建FTP服务器
- 在Ubuntu下使用vsftpd搭建FTP服务器
- 在Ubuntu下使用vsftpd搭建FTP服务器
- 在Ubuntu下使用vsftpd搭建ftp服务器
- Ubuntu下FTP服务器搭建笔记 - vsftpd
- linux下利用vsftpd搭建ftp服务器
- Ubuntu下使用vsftpd配置FTP服务器
- Linux 使用 vsftpd 搭建 ftp 服务器
- linux(ubuntu)下架设FTP(vsftpd)服务器
- ubuntu下搭建ftp服务器vsftpd,cuteFTP登录该服务器
- ubuntu下搭建ftp服务器vsftpd,cuteFTP登录该服务器
- linux vsftpd FTP服务器搭建(一)
- 让UITableView响应touch事件
- Java安全之消息摘要
- spring MVC之用Handler Interceptor拦截请求
- Delphi XE8 及 C++Builder XE8 中文手册即将上市
- Ubuntu 12.04安装rabbitmq
- Linux(Ubuntu)下使用vsftpd搭建ftp服务器
- 黑马程序员----OC常用集合类
- SharePoint 2013 集成嵌入 BI工具 DataZen
- 136A - Presents
- View的位置
- 黑马程序员 JAVA基础学习笔记 包等
- QT事件过滤器
- Mybatis单个参数的if判断(针对异常:There is no getter for property..)
- Docker安装及其应用部署