FTP服务器选择经历和踩坑记,wu-ftp, proftpd 和 vsftpd
环境:
服务器 Linux Debian 10
客户端 Win10 + FileZilla
出发点就是要在自己的服务器上建一个相对安全的文件交换地,同时需要有所谓"监牢",以保证服务器的安全。
- wu-ftp 是款功能强大的老牌 FTP服务器,但安全漏洞比较引人注目,所以选择第一个放弃。
- ProFTP据说是针对Wu-FTP的弱项而开发的,安全性得到了改善,同时还有自己的特点,比如standalone运行模式、设置简单等,也是一款非常流行的FTP Server,但据说不够稳定,所以也放弃了。
- vsftpd 特点是功能强大、配置简单、安全、稳定、速度快,更多也好像不需要了,所以就是它了。
安装:
sudo apt update
sudo apt install vsftpd
配置文件 /etc/vsftpd.conf
# Example config file /etc/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsftpd.conf.5 for all compiled in defaults.
#
# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
# capabilities.
#
#
# Run standalone? vsftpd can run either from an inetd or as a standalone
# daemon started from an initscript.
listen=NO
#
# 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.
listen_ipv6=YES
#
# Allow anonymous FTP? (Disabled by default).
anonymous_enable=NO
#
# Uncomment this to allow local users to log in.
local_enable=YES
#
# Uncomment this to enable any form of FTP write command.
write_enable=YES
#
# Default umask for local users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)
#local_umask=022
#
# Uncomment this to allow the anonymous FTP user to upload files. This only
# has an effect if the above global write enable is activated. Also, you will
# obviously need to create a directory writable by the FTP user.
#anon_upload_enable=YES
#
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
#anon_mkdir_write_enable=YES
#
# Activate directory messages - messages given to remote users when they
# go into a certain directory.
dirmessage_enable=YES
#
# If enabled, vsftpd will display directory listings with the time
# in your local time zone. The default is to display GMT. The
# times returned by the MDTM FTP command are also affected by this
# option.
use_localtime=YES
#
# Activate logging of uploads/downloads.
xferlog_enable=YES
#
# Make sure PORT transfer connections originate from port 20 (ftp-data).
connect_from_port_20=YES
#
# If you want, you can arrange for uploaded anonymous files to be owned by
# a different user. Note! Using "root" for uploaded files is not
# recommended!
#chown_uploads=YES
#chown_username=whoever
#
# You may override where the log file goes if you like. The default is shown
# below.
#xferlog_file=/var/log/vsftpd.log
#
# If you want, you can have your log file in standard ftpd xferlog format.
# Note that the default log file location is /var/log/xferlog in this case.
#xferlog_std_format=YES
#
# You may change the default value for timing out an idle session.
#idle_session_timeout=600
#
# You may change the default value for timing out a data connection.
#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 restrict local users to their home directories. See the FAQ for
# the possible risks in this before using chroot_local_user or
# chroot_list_enable below.
chroot_local_user=YES
user_sub_token=$USER
local_root=/home/$USER/ftp
pasv_min_port=40000
pasv_max_port=41000
userlist_file=/etc/vsftpd.userlist
userlist_deny=NO
# 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
#
# Customization
#
# Some of vsftpd's settings don't fit the filesystem layout by
# default.
#
# This option should be the name of a directory which is empty. Also, the
# directory should not be writable by the ftp user. This directory is used
# as a secure chroot() jail at times vsftpd does not require filesystem
# access.
secure_chroot_dir=/var/run/vsftpd/empty
#
# This string is the name of the PAM service vsftpd will use.
pam_service_name=vsftpd
#
# This option specifies the location of the RSA certificate to use for SSL
# encrypted connections.
rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
ssl_enable=NO
#
# Uncomment this to indicate that vsftpd use a utf8 filesystem.
utf8_filesystem=YES
配置文件2 /etc/vsftpd.userlist,就是用户名,没有其他内容
上面的配置主要是根据这篇网友分享,但有些地方还是有问题。
这就是在这里要提到的坑
如果跟分享里一样用 Linux SSH 去连接FTP
ftp -p 你的服务器域名 / IP
就可能会得到下面的出错提示:
227 Entering Passive Mode (172,31,22,234,171,245).
查了许多地方试了很多方法没有解决,当然没有花时间去读原文的ftp命令解释可能是个错误。
但FTP服务器实际运行正常,在Win10上用 FileZilla就可以完成连接,上传和下载都没有问题,所以首先应该用 sudo systemctl status vsftpd 查看FTP服务器的运行状况,然后直接用FileZilla尝试,这是一条捷径。
还有下面两点:
- 这个设置是用所谓"监牢"的方法完全把访问者限制在local_root=/home/$USER/ftp里面,其他地方都去不了。
- 这个设置没有用加密传输方法,如果用TLS方法还需要装其他的包,有兴趣的朋友可以看这篇分享:Ubuntu搭建vsftpd(以及使用TLS/SSL证书加密)
虽然ftp Server是个原始的网络部分,但对普通爱好者来说还是有点难!
如果不是有特殊用途可以绕过这个麻烦,在Debian上默认已经安装了sftp,许多ftp客户端都支持sftp协议,可以不用装ftp server,直接用sftp就可以了,但这样的信息往往不为人所知,刚刚经历软件公司都不知晓这方面的情况。
分享这10款好用的FTP客户端软件
FTP服务器选择经历和踩坑记,wu-ftp, proftpd 和 vsftpd相关推荐
- 微信公众号服务器配置但没有回调,微信公众号 “服务器配置” 踩坑记
前言 今天工作的时候,碰到一个极其无语的关于微信公众号的坑,为此,我语言攻击了腾讯的机器人客服.然而并没有卵用...万万没想到,我还是解决了这个问题,并记录下踩坑经历,希望能帮到一些朋友吧. 背景 今 ...
- 口罩、安全帽识别比赛踩坑记(二) 比赛流程及 SSD / YOLO V3 两版本实现
本篇文章主要对比赛流程中的各个环节进行展开说明,并对笔者践行过的代码及更改的地方进行记录.如哪里有侵权请联系笔者进行删除.另外在这里对比赛举办方表示感谢 ~ ~ 其中开源代码会在整理后放在github ...
- Go 语言踩坑记——panic 与 recover
题记 Go 语言自发布以来,一直以高性能.高并发著称.因为标准库提供了 http 包,即使刚学不久的程序员,也能轻松写出 http 服务程序. 不过,任何事情都有两面性.一门语言,有它值得骄傲的优点, ...
- 口罩、安全帽识别比赛踩坑记(一) 经验漫谈及随想
前言 因为疫情迎来的史无前例大假期,从开始理直气壮的天天划手机,到中间百无聊赖的躺尸,再到之后实在憋得慌,就想找点什么事搞一搞.恰好这时,一直关注的极视角联合 Intel 公司举办了一个对口罩和安全帽 ...
- python从入门到实践django看不懂_Python编程:从入门到实践踩坑记 Django
<>踩坑记 Django Django Python 19.1.1.5 模板new_topic 做完书上的步骤后,对主题添加页面经行测试,但是浏览器显示 服务器异常. 个人采用的开发环境是 ...
- 东八区转为0时区_踩坑记 | Flink 天级别窗口中存在的时区问题
❝ 本系列每篇文章都是从一些实际的 case 出发,分析一些生产环境中经常会遇到的问题,抛砖引玉,以帮助小伙伴们解决一些实际问题.本文介绍 Flink 时间以及时区问题,分析了在天级别的窗口时会遇到的 ...
- Spring @Transactional踩坑记
@Transactional踩坑记 总述 Spring在1.2引入@Transactional注解, 该注解的引入使得我们可以简单地通过在方法或者类上添加@Transactional注解,实现事务 ...
- 服务器重新部署踩坑记
服务器重新部署踩坑记 Intro 之前的服务器是 Ubuntu 18.04 ,上周周末想升级一下服务器系统,从 18.04 升级到 20.04,结果升级升挂了... 后来 SSH 始终连不上,索性删除 ...
- IdentityServer 部署踩坑记
IdentityServer 部署踩坑记 Intro 周末终于部署了 IdentityServer 以及 IdentityServerAdmin 项目,踩了几个坑,在此记录分享一下. 部署架构 项目是 ...
最新文章
- RESTheart官方文档
- 常用注解[spring 的 java 配置] ||springboot 热部署
- 挑战10个最难回答的Java面试题,我第2题就跪了...
- html怎么设置子目录,如何让主域名指向public_html下的子目录
- hdu1728--------坑爹啊
- [Leetcode]第[58]题[JAVA][最后一个单词的长度][字符串]
- Python next 函数 - Python零基础入门教程
- 题解P3711:【仓鼠的数学题】
- 局域网服务器传输大文件方案,局域网快速传输大文件【操作方案】
- .net工作流框架,拖拽式表单设计,仿钉钉流程设计
- 管网平差c语言编程,哈工大给水管网平差软件
- 唯品会等被纳入MSCI指数,中概股迎来春天
- JavaScript入门语法
- uniapp延迟执行_uniapp如何实现延迟加载
- 使用谷歌扩展程序出现停用情况
- Zotero6.0来了,内容丰富,适合初学者(插件安装,翻译器更新)
- java贪吃蛇博客带图片_java课程设计--贪吃蛇小队博客
- C语言n番战--共用体和枚举(八)
- Java+freemarker 导出Word文档的实现(包括word for Mac 插入域的方法)-静态数据,动态表格list
- 【程序12】模拟掷骰子游戏