![SFTPを使用して接続しようとしたときにカールエラー(2)が発生する[閉じる]](https://linux33.com/image/79791/SFTP%E3%82%92%E4%BD%BF%E7%94%A8%E3%81%97%E3%81%A6%E6%8E%A5%E7%B6%9A%E3%81%97%E3%82%88%E3%81%86%E3%81%A8%E3%81%97%E3%81%9F%E3%81%A8%E3%81%8D%E3%81%AB%E3%82%AB%E3%83%BC%E3%83%AB%E3%82%A8%E3%83%A9%E3%83%BC%EF%BC%882%EF%BC%89%E3%81%8C%E7%99%BA%E7%94%9F%E3%81%99%E3%82%8B%5B%E9%96%89%E3%81%98%E3%82%8B%5D.png)
Telnet経由でログインできることを確認しました。
$ telnet ftp.domain.com 990
Trying xx.xxx.xxx.xx...
Connected to ftp.domain.com. Escape character is '^]'.
sftpを使用して接続しようとすると、次のエラーが発生します。
curl: (2) Failure establishing ssh session
以下を実行してください
curl -u user sftp://ftp.domain.com:990/ToFile/file.csv
パスワードを入力して待ってからエラーが発生します。
FIPSが無効になっていることを確認しました。
cat /proc/sys/crypto/fips_enabled
0
また、以下を試しました。
$ sftp -P 990 [email protected]
ssh_exchange_identification: Connection closed by remote host
Couldn't read packet: Connection reset by peer
その後、次のことを試しました。
$ sftp -o PreferredAuthentications=password -o PubkeyAuthentication=no -P 990 [email protected]
ssh_exchange_identification: Connection closed by remote host
Couldn't read packet: Connection reset by peer
答え1
あなたのサービスはpureを使用しているかもしれませんがftp
、あなたが知らないものに接続することは通常バグの問題に対する領収書です。以下を使って接続できますかftp
?
ftp ftp.domain.com 990
curl -u user ftp://ftp.domain.com:990/ToFile/file.csv
22
SFTPは通常ポートで実行されますssh
。経由でサーバーに接続できますかssh
?あなたのものには何がありますかsshd_config
?エラーは、ssh
試行中のポートが実行されていないことを示します。