使用 sftp 连接到“FTP over TLS”

Joh*_*ith 4 ftp ssh sftp

我现在已经浪费了一个多小时,我认为这应该很简单......

我有一个 azure 网站,它允许我使用 sftp 连接和部署到它。我可以使用 FileZilla 通过以下设置很好地连接到它:

  • 主机:Azure Portal 提供的主机
  • 端口:空
  • 协议:FTP - 文件传输协议
  • 加密:需要隐式 FTP over TLS
  • 登录类型:普通
  • 用户:Azure 门户提供的用户名
  • 密码:Azure 门户提供的密码。

不过,我不想使用 FileZilla 连接到它。我想使用命令行移动文件。我一直在尝试使用sftpftpscp均无功而返。最后,他们都失败了:

$ sftp -v -oPort=990 user@xxxxx.ftp.azurewebsites.windows.net
OpenSSH_7.9p1, OpenSSL 1.0.2r  26 Feb 2019
debug1: Reading configuration data /home/rg/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 17: Applying options for *
debug1: Connecting to xxxxxxx.azurewebsites.windows.net [xxx.xxx.xxx.xxx] port 990.
debug1: Connection established.
debug1: identity file /home/rg/.ssh/id_rsa type 0
debug1: identity file /home/rg/.ssh/id_rsa-cert type -1
debug1: identity file /home/rg/.ssh/id_dsa type -1
debug1: identity file /home/rg/.ssh/id_dsa-cert type -1
debug1: identity file /home/rg/.ssh/id_ecdsa type -1
debug1: identity file /home/rg/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/rg/.ssh/id_ed25519 type -1
debug1: identity file /home/rg/.ssh/id_ed25519-cert type -1
debug1: identity file /home/rg/.ssh/id_xmss type -1
debug1: identity file /home/rg/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.9
ssh_exchange_identification: Connection closed by remote host
Connection closed.
Connection closed
Run Code Online (Sandbox Code Playgroud)

我已经测试过使用中的 OpenSSL 版本支持 TLS 1.2。已知主机中的主机也没有另一个指纹。

我希望有人能在这里帮助我。

Mar*_*ryl 7

FTP(通过 TLS)不是 SFTP。

如果您可以使用 FTP 与 FileZilla 进行连接,则必须使用命令行 FTP 客户端。不是 SFTP 客户端。尽管并非所有命令行 FTP 客户端都支持 TLS 加密。


rex*_*ans 6

这又是 FTP 和 SSH 之间的混淆:

  • FTPS 是基于 TLS 的 FTP(比较:HTTPS 是基于 TLS 的 HTTP)。它使用 TCP 端口 21,如果不是被动模式,防火墙必须允许来自外部的连接。
  • SFTP 是 SSH 的一个子系统。它使用 TCP 端口 22。

FileZilla 两者都支持。