JSch 连接到 ftp.secureftp-test.com
因此,我使用了 http://www.jcraft.com/jsch/examples/ 上的示例Sftp.java 和我试图连接到 ftp.secureftp-test.com。
该目标是有效的测试 SFTP 服务器(如 secureftp-test dot com/ 中所述)。我通过 nautilus 连接到服务器确认了这一点。我还确保我的程序上的密码也正确。
但是,当我运行程序并点击 session.connect() 时,它只是显示“信息:已建立连接”,然后它会安静一分钟,然后返回: “com.jcraft.jsch.JSchException:连接被外部主机关闭”
我很确定它卡在了库的 while 循环中,但我不知道为什么。我在本地 ftp 服务器上尝试过,它也有同样的问题。
在安静的时刻,我可以打字。但按 Enter 键不会向服务器发送任何内容。
有人听说过或见过同样的问题吗?
So, I used the example on http://www.jcraft.com/jsch/examples/Sftp.java and I was trying to connect to ftp.secureftp-test.com.
That destination is a valid testing SFTP server (as mentioned in secureftp-test dot com/). I confirmed it by connecting to the server through nautilus. I also made sure that the password on my program was correct as well.
But, when I run the program and it hits session.connect(), it just says "INFO: Connection established" then it becomes quiet for a minute then it return:
"com.jcraft.jsch.JSchException: connection is closed by foreign host"
I am pretty sure that it got stuck in the while loop of the library but I do not know why. I tried it against my local ftp server and it also had the same problem.
During the quiet moment, I can type. But pressing enter does not send anything to the server.
Has anyone heard or seen the same problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,看来 secureftp-test.com 不是 sftp 服务器。那就是ftps服务器。
我所做的是创建我自己的 sftp:
http://wiki.vpslink.com/Configuring_vsftpd_for_secure_connections_(TLS/SSL/SFTP) )
然后运行示例代码,但在执行
session.connect
之前确保我有这些行:Okay, it seems that secureftp-test.com is NOT an sftp server. That is ftps server.
What I did instead was creating my own sftp:
http://wiki.vpslink.com/Configuring_vsftpd_for_secure_connections_(TLS/SSL/SFTP)
Then run the example code but making sure that I have these lines before doing
session.connect
: