- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
使用 Ubuntu 18.04 LTS 和 ProFTPD 1.3.5e。
我有 ProFTPD 在端口 20、21 上提供 FTP 服务并且运行良好。
当我添加/etc/proftpd/conf.d/sftp.conf 时,FTP 停止工作。当我删除 sftp.conf 并重新启动 proftpd 时,FTP 再次开始工作。我的结论是这个 conf 文件有问题。
另外,我希望 sftp 只接受登录 ID 和密码进行身份验证。我怎么做?我查看了 SFTPAuthMethods 指令,看起来如果我忽略它,它将允许所有身份验证方法,这对我来说没问题。
这是 sftp.conf 文件:
<IfModule mod_sftp.c>
SFTPEngine on
Port 2222
SFTPLog /var/log/proftpd/sftp.log
# Configure both the RSA and DSA host keys, using the same host key
# files that OpenSSH uses.
SFTPHostKey /etc/ssh/ssh_host_rsa_key
SFTPHostKey /etc/ssh/ssh_host_dsa_key
SFTPAuthorizedUserKeys file:/etc/proftpd/authorized_keys/%u
# Enable compression
SFTPCompression delayed
</IfModule>
<snip>
<IfModule mod_sftp.c>
<VirtualHost 0.0.0.0>
# The SFTP configuration
SFTPEngine on
Port 2222
SFTPLog /var/log/proftpd/sftp.log
Include /etc/proftpd/sql.conf
SFTPAuthMethods password keyboard-interactive hostbased publickey
# Configure both the RSA and DSA host keys, using the same host key
# files that OpenSSH uses.
SFTPHostKey /etc/ssh/ssh_host_rsa_key
SFTPHostKey /etc/ssh/ssh_host_dsa_key
SFTPAuthorizedUserKeys file:/etc/proftpd/authorized_keys/%u
# Enable compression
SFTPCompression delayed
</VirtualHost>
</IfModule>
2020-04-21 21:03:50,340 mod_sftp/0.9.9[13017]: sent server version 'SSH-2.0-mod_sftp/0.9.9'
2020-04-21 21:03:50,355 mod_sftp/0.9.9[13017]: received client version 'SSH-2.0-WinSCP_release_5.17.3'
2020-04-21 21:03:50,355 mod_sftp/0.9.9[13017]: handling connection from SSH2 client 'WinSCP_release_5.17.3'
2020-04-21 21:03:51,284 mod_sftp/0.9.9[13017]: + Session key exchange: ecdh-sha2-nistp256
2020-04-21 21:03:51,284 mod_sftp/0.9.9[13017]: + Session server hostkey: ssh-rsa
2020-04-21 21:03:51,284 mod_sftp/0.9.9[13017]: + Session client-to-server encryption: aes256-ctr
2020-04-21 21:03:51,284 mod_sftp/0.9.9[13017]: + Session server-to-client encryption: aes256-ctr
2020-04-21 21:03:51,284 mod_sftp/0.9.9[13017]: + Session client-to-server MAC: hmac-sha2-256
2020-04-21 21:03:51,284 mod_sftp/0.9.9[13017]: + Session server-to-client MAC: hmac-sha2-256
2020-04-21 21:03:51,285 mod_sftp/0.9.9[13017]: + Session client-to-server compression: none
2020-04-21 21:03:51,285 mod_sftp/0.9.9[13017]: + Session server-to-client compression: none
2020-04-21 21:03:51,957 mod_sftp/0.9.9[13017]: sending acceptable userauth methods: password,keyboard-interactive,hostbased,publickey
2020-04-21 21:03:52,302 mod_sftp/0.9.9[13017]: expecting USER_AUTH_INFO_RESP message, received SSH_MSG_IGNORE (2)
2020-04-21 21:03:52,322 mod_sftp_pam/0.3[13017]: PAM authentication error (7) for user 'test': Authentication failure
最佳答案
这是完整的/etc/proftpd/proftpd.conf,它实现了我的上述目标。
请注意,我还使用 mod_sql 通过 MySQL 提供身份验证。因此,此配置文件引用了其他配置文件,但未在此发布中列出。
# cat /etc/proftpd/proftpd.conf
# /etc/proftpd/proftpd.conf -- This is a basic ProFTPD configuration file.
# To really apply changes, reload proftpd after modifications, if
# it runs in daemon mode. It is not required in inetd/xinetd mode.
#
# Includes DSO modules
Include /etc/proftpd/modules.conf
# Set off to disable IPv6 support which is annoying on IPv4 only boxes.
UseIPv6 on
# If set on you can experience a longer connection delay in many cases.
IdentLookups off
ServerName "hostname"
# Set to inetd only if you would run proftpd by inetd/xinetd.
# Read README.Debian for more information on proper configuration.
ServerType standalone
DeferWelcome off
MultilineRFC2228 on
DefaultServer on
ShowSymlinks on
TimeoutNoTransfer 600
TimeoutStalled 600
TimeoutIdle 1200
DisplayLogin welcome.msg
DisplayChdir .message true
ListOptions "-l"
DenyFilter \*.*/
# Use this to jail all users in their homes
DefaultRoot ~
# This line will create the user directories of an FTP user if they successfully authenticate but do not have a user directory.
# See http://www.proftpd.org/docs/howto/CreateHome.html
# CreateHome off|on [<mode>] [skel <path>] [dirmode <mode>] [uid <uid>] [gid <gid>] [homegid <gid>] [NoRootPrivs]
CreateHome on dirmode 750
# Users require a valid shell listed in /etc/shells to login.
# Use this directive to release that constrain.
RequireValidShell off
# Port 21 is the standard FTP port.
Port 21
# In some cases you have to specify passive ports range to by-pass
# firewall limitations. Ephemeral ports can be used for that, but
# feel free to use a more narrow range.
# PassivePorts 49152 65534
# If your host was NATted, this option is useful in order to
# allow passive transfers to work. You have to use your public
# address and opening the passive ports used on your firewall as well.
# MasqueradeAddress 1.2.3.4
# This is useful for masquerading address with dynamic IPs:
# refresh any configured MasqueradeAddress directives every 8 hours
<IfModule mod_dynmasq.c>
# DynMasqRefresh 28800
</IfModule>
# To prevent DoS attacks, set the maximum number of child processes
# to 30. If you need to allow more than 30 concurrent connections
# at once, simply increase this value. Note that this ONLY works
# in standalone mode, in inetd mode you should use an inetd server
# that allows you to limit maximum number of processes per service
# (such as xinetd)
MaxInstances 50
# Set the user and group that the server normally runs at.
User proftpd
Group nogroup
# Umask 022 is a good standard umask to prevent new files and dirs
# (second parm) from being group and world writable.
Umask 022 022
# Normally, we want files to be overwriteable.
AllowOverwrite on
# Uncomment this if you are using NIS or LDAP via NSS to retrieve passwords:
# PersistentPasswd off
# This is required to use both PAM-based authentication and local passwords
# AuthOrder mod_auth_pam.c* mod_auth_unix.c
# Be warned: use of this directive impacts CPU average load!
# Uncomment this if you like to see progress and transfer rate with ftpwho
# in downloads. That is not needed for uploads rates.
#
# UseSendFile off
TransferLog /var/log/proftpd/xferlog
SystemLog /var/log/proftpd/proftpd.log
# Logging onto /var/log/lastlog is enabled but set to off by default
#UseLastlog on
# In order to keep log file dates consistent after chroot, use timezone info
# from /etc/localtime. If this is not set, and proftpd is configured to
# chroot (e.g. DefaultRoot or <Anonymous>), it will use the non-daylight
# savings timezone regardless of whether DST is in effect.
#SetEnv TZ :/etc/localtime
<IfModule mod_quotatab.c>
QuotaEngine off
</IfModule>
<IfModule mod_ratio.c>
Ratios off
</IfModule>
# Delay engine reduces impact of the so-called Timing Attack described in
# http://www.securityfocus.com/bid/11430/discuss
# It is on by default.
<IfModule mod_delay.c>
DelayEngine on
</IfModule>
<IfModule mod_ctrls.c>
ControlsEngine off
ControlsMaxClients 2
ControlsLog /var/log/proftpd/controls.log
ControlsInterval 5
ControlsSocket /var/run/proftpd/proftpd.sock
</IfModule>
<IfModule mod_ctrls_admin.c>
AdminControlsEngine off
</IfModule>
#
# Alternative authentication frameworks
#
#Include /etc/proftpd/ldap.conf
Include /etc/proftpd/sql.conf
#
# This is used for FTPS connections
#
#Include /etc/proftpd/tls.conf
#
# Useful to keep VirtualHost/VirtualRoot directives separated
#
#Include /etc/proftpd/virtuals.conf
# A basic anonymous configuration, no upload directories.
# <Anonymous ~ftp>
# User ftp
# Group nogroup
# # We want clients to be able to login with "anonymous" as well as "ftp"
# UserAlias anonymous ftp
# # Cosmetic changes, all files belongs to ftp user
# DirFakeUser on ftp
# DirFakeGroup on ftp
#
# RequireValidShell off
#
# # Limit the maximum number of anonymous logins
# MaxClients 10
#
# # We want 'welcome.msg' displayed at login, and '.message' displayed
# # in each newly chdired directory.
# DisplayLogin welcome.msg
# DisplayChdir .message
#
# # Limit WRITE everywhere in the anonymous chroot
# <Directory *>
# <Limit WRITE>
# DenyAll
# </Limit>
# </Directory>
#
# # Uncomment this if you're brave.
# # <Directory incoming>
# # # Umask 022 is a good standard umask to prevent new files and dirs
# # # (second parm) from being group and world writable.
# # Umask 022 022
# # <Limit READ WRITE>
# # DenyAll
# # </Limit>
# # <Limit STOR>
# # AllowAll
# # </Limit>
# # </Directory>
#
# </Anonymous>
# Include other custom configuration files
Include /etc/proftpd/conf.d/
<IfModule mod_sftp.c>
<VirtualHost 0.0.0.0>
# The SFTP configuration
SFTPEngine on
Port 2222
SFTPAuthMethods password
RequireValidShell off
SFTPLog /var/log/proftpd/sftp.log
Include /etc/proftpd/sql.conf
# Configure both the RSA and DSA host keys, using the same host key
# files that OpenSSH uses.
SFTPHostKey /etc/ssh/ssh_host_rsa_key
SFTPHostKey /etc/ssh/ssh_host_dsa_key
#SFTPAuthorizedUserKeys file:/etc/proftpd/authorized_keys/%u
# Enable compression
SFTPCompression delayed
DefaultRoot ~
</VirtualHost>
</IfModule>
# Time stamp - IP Address - Protocol - User Name - UID - Filename - File Sizeo - Response Time in Milliseconds - Transfer Time in Seconds - Transfer Status - Reason for failure if applicable
# http://www.proftpd.org/docs/modules/mod_log.html#LogFormat
LogFormat custom "%{iso8601} %a %{protocol} %u %{uid} %f %{file-size} %R %T %{transfer-status} %{transfer-failure}"
ExtendedLog /var/log/proftpd/custom.log READ,WRITE custom
关于proftpd - 配置 proftpd 同时服务 ftp 和 sftp,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61333456/
使用 Ubuntu 18.04 LTS 和 ProFTPD 1.3.5e。 我有 ProFTPD 在端口 20、21 上提供 FTP 服务并且运行良好。 当我添加/etc/proftpd/conf.d
我已阅读 ftp 上的所有命令,其中不包含更改密码的命令。 我是proftpd的用户,我自己登录proftpd后如何更改密码,而不是通过管理员登录? 用户可以在ssh服务中修改自己的密码,不用通过ad
如果有人能帮我解决 ProFTPd 的 PathAllowFilter 的正则表达式,我将不胜感激。 这是我到目前为止的正则表达式: (.mp3|.aac|.m4a)$ 它只允许 mp3、aac 和
在我的 ftp 树中有一个我不想通过匿名访问的目录。 我能够隐藏有问题的目录和目录中的所有文件。 我没能做到的是阻止某人导航到该目录。 因此,如果有人导航到 ftp.site.com,他们将不会看到“
我正在尝试在 proftpd 服务器上指定一个目录,该目录不允许用户将文件上传到特定目录。在更新期间,我不希望向此目录写入任何内容,但更重要的是,我希望向用户返回一条有意义的消息。我发现我可以在配置中
我想知道是否有检查上传到您的 ftp 服务器是否成功的最佳实践。 我正在使用的系统有一个上传目录,其中包含上传文件的每个用户的子目录。 这些目录中的文件只是临时的,一旦处理它们就会被丢弃。 系统循环遍
我对 linux Ubuntu 很陌生,并从 Windows 迁移过来。 我遇到的问题与ftp有关。这就是我想要做的。 我的网站位于/var/www。例如,每个网站都有自己的根 /var/www/si
我已经在我的 macOS Mojave 上安装了 XAMPP。当我运行这个命令 'sudo/Applications/XAMPP/xamppfiles/xampp start' 我收到以下错误: 为
我已经问了一个安静的similar question但事实上我现在改变了主意。 我想编译 proftpd 并将其使用的库的拷贝添加到所选的安装目录中。 假设我在编译中定义了一个前缀,例如: /usr/
我正在尝试在 Ubuntu 服务器 11.10 64 位上安装带有 MySQL 的 ProFTPd。但我无法登录,总是显示“登录错误” 这是我的 sql.conf 文件: # add the foll
我正在尝试限制 proftpd 中特定用户(例如 bob)的访问。我有一些用户可以访问整个服务器,但 1 个特定用户应该只能访问 2 个文件夹。有这样的结构: /var/www/site/ /var/
我正在尝试解决这个问题: 2014-04-07 14:00:58,628 srv proftpd[10143] srv (pfsense.localdomain[192.168.0.1]): FTP
我正在尝试使用 Proftpd 配置 SFTP。我已经使用 Unix 用户成功配置了 SFTP,但现在我想使用虚拟用户,因为我将有大量用户需要添加/删除。我希望用户使用用户名/密码登录。 为此,我首先
无法进入我的 ftp 服务器。我使用 proftpd 1.3.4a 和 mod_tls/2.4.3。 我怀疑 TLSOptions 指令有误 TLSEngine
我已将 ProFTPD 配置为在 Plesk 支持的服务器上记录所有身份验证。自 Plesk 10 以来,默认情况下不设置此设置(为什么...)。我想配置 fail2ban,以检测不成功的登录尝试以防
我的站点上有一些目录,我希望匿名 ftp 用户可以访问这些目录,但它们不应该是可见的。所以我不希望他们在键入“ls”或“dir”时出现,但我希望用户能够键入“cd secret_dir”。 我希望这样
我尝试将proftpd配置为与SFTP一起使用并与虚拟用户一起使用,但是尝试了几种方式后,它不适用于虚拟用户。仅适用于系统用户 相对于下面问题的一些配置,这里是完整的proftpd.conf Auth
我找了很久也没找到解决办法。我正在尝试将文件从我的计算机上传到我的 ftp 服务器。但每次我尝试时,我都只创建一个 0kb 文件。 我已经尝试过 关闭防火墙 在文件夹上执行 chmod -R 775
我使用这段代码从 mod_exec proftpd 执行外部脚本。 执行引擎开启 ExecLog/opt/proftpd_mod_exec.log ExecOptions logStderr logS
我正在尝试使用 phpseclib 在 PHP 上安装 proftpd。 我正在使用此命令开始安装: $sshconid->exec("apt-get install proftpd-basic -y
我是一名优秀的程序员,十分优秀!