如何修复 SFTP 的 Proftpd 问题?

如何修复 SFTP 的 Proftpd 问题?

我在 Centos Server 中安装了 proftpd,主要用于安全 ftp 访问。但是,用户经常能够访问 sftp 服务器。

当我使用 ftpwho 检查每个 FTP 会话的当前进程信息时,出现如下错误。

30525 (none)   [15h27m] (authenticating)
30686 (none)   [15h26m] (authenticating)
31927 (none)   [15h26m] (authenticating)
32029 (none)   [15h25m] (authenticating)
32251 (none)   [15h25m] (authenticating)
32364 (none)   [15h24m] (authenticating)
18396 (none)   [ 14h9m] (authenticating)
19608 (none)   [ 14h9m] (authenticating)
19726 (none)   [ 14h9m] (authenticating)
19887 (none)   [ 14h8m] (authenticating)
20059 (none)   [ 14h8m] (authenticating)
20092 (none)   [ 14h7m] (authenticating)
20122 (none)   [ 14h7m] (authenticating)
20262 (none)   [ 14h7m] (authenticating)

下面是我的 proftpd 配置文件

 ServerName                      "ProFTPD"
    AuthUserFile /etc/proftpd/passwd.vhosts
    ServerType                      standalone
    DeferWelcome                    off
    DefaultServer                   on
    DefaultRoot ~ !wheel

# Port 21 is the standard FTP port.
IdentLookups off

<IfModule mod_tls.c>
    TLSEngine on
    TLSProtocol SSLv23
    TLSRequired off
    TLSRSACertificateFile /etc/ftpd-rsa.pem
    TLSRSACertificateKeyFile /etc/ftpd-rsa-key.pem
    TLSVerifyClient off
    TLSCipherSuite HIGH:MEDIUM:+TLSv1:!SSLv2:+SSLv3
     TLSOptions NoSessionReuseRequired
</IfModule>
#AuthPAM off
TransferLog /usr/local/apache/domlogs/ftpxferlog
UseReverseDNS off


Port                7634
# Umask 022 is a good standard umask to prevent new dirs and files
# from being group and world writable.
Umask                           022

# Set the user and group that the server normally runs at.
User                            root
Group               nobody
SFTPEngine      On
SFTPHostKey /etc/ssh/ssh_host_rsa_key
SFTPHostKey /etc/ssh/ssh_host_dsa_key

DefaultRoot /home
# Normally, we want files to be overwriteable.
<Directory />
  AllowOverwrite                on
</Directory>

# A basic anonymous configuration, no upload directories.
<Anonymous ~ftp>
UseFtpUsers on
RequireValidShell off
  User                          ftp
  Group                         ftp
  # We want clients to be able to login with "anonymous" as well as "ftp"
  UserAlias                     anonymous ftp

  # 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 true

  # Limit WRITE everywhere in the anonymous chroot
  <Limit WRITE>
    DenyAll
  </Limit>
</Anonymous>

谁能提供解决方案?

答案1

CentOS / RHEL 版本的 ProFTPd 没有内置 mod_sftp。

您必须使用支持重新编译它。这里有一篇很棒的博客文章,涵盖了以下主题:

http://redhatvn.net/how-to-sftp-support-in-proftpd

我还应该指出,大多数情况下,sftp 由 OpenSSH 守护进程负责。ProFTPd 的 mod_sftp 是一个相对较新的开发,可能也没有记录。

相关内容