AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 1080187
Accepted
zeerk
zeerk
Asked: 2021-10-12 03:33:32 +0800 CST2021-10-12 03:33:32 +0800 CST 2021-10-12 03:33:32 +0800 CST

通过 SFTP 和 FTP 进行 ProFTPd 配置

  • 772

我有一个实际使用 FTP 协议的 ProFTPd,但我也想使用 SFTP。
我找到了一个带有<VirtualHost>块的解决方案,但它对我不起作用。

  <IfModule mod_sftp.c>
      <VirtualHost 0.0.0.0>

        TLSEngine          off
        SFTPEngine         on
        Port               2222
        SFTPLog            /var/log/proftpd/sftp.log
        Include            /etc/proftpd/sql.conf

        SFTPHostKey        /etc/ssh/ssh_host_rsa_key
        SFTPHostKey        /etc/ssh/ssh_host_ecdsa_key

        SFTPCompression    delayed
        DefaultRoot        ~
        RequireValidShell  on

     </VirtualHost>
  </IfModule>


这是`/var/log/proftpd/sftp.log`的输出

2021-10-11 11:03:32,289 mod_sftp/0.9.9[20791]: using '/etc/ssh/ssh_host_ecdsa_key' as 256-bit ECDSA hostkey
2021-10-11 11:03:32,289 mod_sftp/0.9.9[20791]: using '/etc/ssh/ssh_host_ecdsa_key' as 256-bit ECDSA hostkey
2021-10-11 11:03:32,291 mod_sftp/0.9.9[20791]: sent server version 'SSH-2.0-SFTP Server'
2021-10-11 11:03:32,291 mod_sftp/0.9.9[20791]: received client version 'SSH-2.0-PuTTYFileZilla_3.46.3'
2021-10-11 11:03:32,291 mod_sftp/0.9.9[20791]: handling connection from SSH2 client 'PuTTYFileZilla_3.46.3'
2021-10-11 11:03:32,363 mod_sftp/0.9.9[20791]:  + Session key exchange: ecdh-sha2-nistp256
2021-10-11 11:03:32,363 mod_sftp/0.9.9[20791]:  + Session server hostkey: ecdsa-sha2-nistp256
2021-10-11 11:03:32,363 mod_sftp/0.9.9[20791]:  + Session client-to-server encryption: aes256-ctr
2021-10-11 11:03:32,363 mod_sftp/0.9.9[20791]:  + Session server-to-client encryption: aes256-ctr
2021-10-11 11:03:32,363 mod_sftp/0.9.9[20791]:  + Session client-to-server MAC: hmac-sha2-256
2021-10-11 11:03:32,363 mod_sftp/0.9.9[20791]:  + Session server-to-client MAC: hmac-sha2-256
2021-10-11 11:03:32,363 mod_sftp/0.9.9[20791]:  + Session client-to-server compression: none
2021-10-11 11:03:32,363 mod_sftp/0.9.9[20791]:  + Session server-to-client compression: none
2021-10-11 11:03:32,504 mod_sftp/0.9.9[20791]: sending acceptable userauth methods: keyboard-interactive,password
2021-10-11 11:03:32,626 mod_sftp/0.9.9[20791]: expecting USER_AUTH_INFO_RESP message, received SSH_MSG_IGNORE (2)
2021-10-11 11:03:32,627 mod_sftp_pam/0.3[20791]: PAM authentication error (7) for user 'sql_user': Authentication failure
2021-10-11 11:03:32,627 mod_sftp/0.9.9[20791]: sending userauth failure; remaining userauth methods: keyboard-interactive,password
2021-10-11 11:03:32,628 mod_sftp/0.9.9[20791]: unhandled SSH_MSG_USER_AUTH_INFO_RESP (61) message, disconnecting
2021-10-11 11:03:32,628 mod_sftp/0.9.9[20791]: disconnecting (Unsupported protocol sequence)
ubuntu virtualhost sftp proftpd
  • 1 1 个回答
  • 525 Views

1 个回答

  • Voted
  1. Best Answer
    Zareh Kasparian
    2021-10-12T04:46:32+08:002021-10-12T04:46:32+08:00

    正确的。让您的 FTP 守护进程在 FTP/21 和 SFTP/2222 上工作的解决方案是在 <IfModule mod_sftp.c> 中包含 <VirtualHost 0.0.0.0> 部分。

    我在 /etc/proftpd/proftpd.conf 中共享我的配置文件的这一部分,它工作正常。

    <VirtualHost 0.0.0.0>
      
        SFTPEngine on
        Port 2222
        SFTPAuthMethods password
        RequireValidShell      off
        SFTPLog /var/log/proftpd/sftp.log
        Include /etc/proftpd/sql.conf
    
        SFTPHostKey /etc/ssh/ssh_host_rsa_key
        SFTPHostKey /etc/ssh/ssh_host_dsa_key
        
        SFTPCompression delayed
        DefaultRoot
    </VirtualHost>
    
    • 2

相关问题

  • 无法通过 Ubuntu VPN 访问外部网络

  • ubuntu apt-get upgrade - 如何在 shell 中单击确定?

  • VirtualBox 上 Ubuntu 的访客优化技巧 [关闭]

  • 外部硬盘上的 virtualbox 虚拟硬盘驱动器(Vista 主机上的 ubuntu 客户机)

  • 如何在 Ubuntu 上挂载 LVM 分区?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve