- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用 Java 安全通道 (JSCh) 建立 SFTP 连接。我的软件堆栈是 Red Hat Enterprise Server 5.0、JRE 6.0 和 JSch v0.1.44。主要的服务器软件堆栈(我尝试连接的)是 Windows Server 2008 和最新版本的 GlobalScape。当尝试连接到它时,我得到一个
com.jcraft.jsch.JSchException: Algorithm negotiation fail
at com.jcraft.jsch.Session.receive_kexinit(Session.java:529)
at com.jcraft.jsch.Session.connect(Session.java:291)
启用 JSch 日志记录,对于同一连接,我得到以下信息:
0000001d SystemErr R INFO: Connecting to xxx.xxx.xxx.157 port 22
0000001d SystemErr R INFO: Connection established
0000001d SystemErr R INFO: Remote version string: SSH-2.0-1.36_sshlib GlobalSCAPE
0000001d SystemErr R INFO: Local version string: SSH-2.0-JSCH-0.1.44
0000001d SystemErr R INFO: CheckCiphers: aes256-ctr,aes192-ctr,aes128-ctr,aes256- cbc,aes192-cbc,aes128-cbc,3des-ctr,arcfour,arcfour128,arcfour256
0000001d SystemErr R INFO: aes256-ctr is not available.
0000001d SystemErr R INFO: aes192-ctr is not available.
0000001d SystemErr R INFO: aes256-cbc is not available.
0000001d SystemErr R INFO: aes192-cbc is not available.
0000001d SystemErr R INFO: arcfour256 is not available.
0000001d SystemErr R INFO: SSH_MSG_KEXINIT sent
0000001d SystemErr R INFO: SSH_MSG_KEXINIT received
0000001d SystemErr R INFO: Disconnecting from xxx.xxx.xxx.157 port 22
因此,从外观上看,我正在连接到服务器,并且实际上可以发送和接收消息,但是当客户端尝试匹配服务器消息提案和客户端消息提案时,它会引发异常。
现在将其与使用以前的 GlobalScape 软件和 Windows Server 2003 成功连接到服务器的 JSch 日志进行比较:
0000001e SystemErr R INFO: Connecting to xxx.xxx.xxx.156 port 22
0000001e SystemErr R INFO: Connection established
0000001e SystemErr R INFO: Remote version string: SSH-2.0-1.36 sshlib: GlobalScape
0000001e SystemErr R INFO: Local version string: SSH-2.0-JSCH-0.1.44
0000001e SystemErr R INFO: CheckCiphers: aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,3des-ctr,arcfour,arcfour128,arcfour256
0000001e SystemErr R INFO: aes256-ctr is not available.
0000001e SystemErr R INFO: aes192-ctr is not available.
0000001e SystemErr R INFO: aes256-cbc is not available.
0000001e SystemErr R INFO: aes192-cbc is not available.
0000001e SystemErr R INFO: arcfour256 is not available.
0000001e SystemErr R INFO: SSH_MSG_KEXINIT sent
0000001e SystemErr R INFO: SSH_MSG_KEXINIT received
0000001e SystemErr R INFO: kex: server->client aes128-cbc hmac-md5 none
0000001e SystemErr R INFO: kex: client->server aes128-cbc hmac-md5 none
0000001e SystemErr R INFO: SSH_MSG_KEXDH_INIT sent
0000001e SystemErr R INFO: expecting SSH_MSG_KEXDH_REPLY
0000001e SystemErr R INFO: ssh_dss_verify: signature true
0000001e SystemErr R WARN: Permanently added 'xxx.xxx.xxx.156' (DSA) to the list of known hosts.
0000001e SystemErr R INFO: SSH_MSG_NEWKEYS sent
0000001e SystemErr R INFO: SSH_MSG_NEWKEYS received
0000001e SystemErr R INFO: SSH_MSG_SERVICE_REQUEST sent
0000001e SystemErr R INFO: SSH_MSG_SERVICE_ACCEPT received
0000001e SystemErr R INFO: Authentications that can continue: publickey,keyboard-inteactive,password
0000001e SystemErr R INFO: Next authentication method: publickey
0000001e SystemErr R INFO: Authentications that can continue: password
0000001e SystemErr R INFO: Next authentication method: password
0000001e SystemErr R INFO: Authentication succeeded (password).
因此它再次能够连接并能够交换 SSH_MSG_KEXINIT,但这里客户端和服务器提案匹配并且不会抛出异常
sftp 安全性使用公钥/私钥和用户名/密码。
我可以使用 WinSCP、Filezilla 和 linux 命令行(从运行 java 应用程序的同一服务器)连接到它。
我与 SFTP 服务器的一位系统管理员进行了交谈,我们尝试使用用户名/密码,但我得到了相同的异常和日志。
系统管理员告诉我,两台服务器之间的区别是 GlobalScape 版本,现在是 Microsoft 2008 Server。
那么有人对如何解决这个问题有任何想法吗?
非常感谢!
最佳答案
您遇到的问题与全局无关,它与所有启用的密码算法 SFTP 服务器有关。每个 sftp 服务器都有一些他们同意的密码算法,因此如果您没有这些密码编码和算法,它就无法工作密码算法所有其他 SFTP 软件都有内置的密码算法,它们根据 sftp 服务器配置更改为最新的 256 位密码算法使用,您已全部设置完毕
https://enterprisedt.com/products/edtftpjssl/doc/manual/html/howtousesftpchoosingalgorithms.html
公钥算法
可以为服务器身份验证的首选公钥算法设置 DSA 或 RSA 或两者。例如,如果设置了 RSA,服务器将向客户端提供 RSA 公钥(当然,如果服务器支持 RSA key - 有些服务器不支持)。下面的代码说明了如何仅设置 RSA。它首先禁用所有 key 对算法,然后启用 RSA:
ftp.disableAllAlgorithms(SSHFTPAlgorithm.KEY_PAIR);ftp.setAlgorithmEnabled(SSHFTPAlgorithm.KEY_RSA, true);
默认情况下同时启用 DSA 和 RSA。
密码算法
密码算法是用于执行 SFTP 数据和命令加密的对称算法。下面的代码说明了如何将三重 DES 设置为密码算法(禁用所有其他算法):
ftp.disableAllAlgorithms(SSHFTPAlgorithm.CIPHER);ftp.setAlgorithmEnabled(SSHFTPAlgorithm.CIPHER_3DES_CBC, true);
默认启用所有密码算法。
关于java - 使用 JSch 和 GlobalScape 的 SFTP,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5564533/
如果您登录到 sftp 服务器, 用户名和密码是否安全发送? 或者您是否必须进行基于证书的身份验证以确保整个传输都是加密的? 如果这是依赖于客户端的,那么您知道 Tumbleweed 和 WinSCP
我们如何在不安装任何软件/工具的情况下验证服务器上是否已授予 SFTP 访问权限? 最佳答案 大多数服务器有 curl和 scp安装,您可以使用它登录到 SFTP 服务器。要使用 curl 测试您的凭
我需要为 SFTP 执行校验和(为了数据完整性)。我希望这可以在 SFTP 文件传输期间完成 - 我意识到这可能取决于产品(仅供引用:使用 CLEO VLTrader),但想知道这是否是惯例? 我也在
关闭。这个问题是off-topic .它目前不接受答案。 想改进这个问题? Update the question所以它是on-topic对于堆栈溢出。 8年前关闭。 Improve this que
我目前有一个 SFTP 脚本,它通过每天在 cron 上运行的 SSH 将最新版本的文件上传到服务器。但是我总是收到这样的电子邮件(我将服务器更改为 example.com fyi) /etc/cro
是否有使用“sftp”将远程服务器上的远程文件移动到另一个目录(在同一远程服务器上)的单行程序? 最佳答案 对于sftp,它是rename。如果你要求调用 sftp,使用 bash 就像是 sftp
嗨,我需要使用 NetSuite sFtp 功能从保存的搜索和 ftp'it 创建一个文件到另一台服务器。我想知道返回的数据后如何创建文件并将其传递给 FTP 对象?它将是一种csv形式,我可以将
我在 SFTP 位置创建了一个目录,我想将文件从一个 SFTP 目录移动到另一个目录,但是 cp那里不支持命令。 我怎样才能做到这一点? 最佳答案 核心 SFTP 协议(protocol)不支持复制远
我正在努力解决的问题有点复杂。我先向您解释设置环境。 我正在使用 PHPStorm 来处理 Symony2 项目。 我的 Apache 托管在通过“部署工具”连接到 PHPStorm 的 Debian
使用FTP,一切正常...但是.. 当我使用 SFTP 时,它成功连接,甚至当我使用“上传按钮”时,它成功上传文件...但是当我编辑+保存文件,它开始自动上传更改时,它无法上传(红色消息:文件....
我想将文件从远程服务器复制到不同目录中。例如,我想一次运行这4个命令。 scp remote:A/1.txt local:A/1.txt scp remote:A/2.txt local:A/2.tx
我可以使用 ssh/sftp(不带 -b 选项)登录我的 Remote sftp root@192.168.7.2 但是当我尝试 sftp -b commands.tmp root@192.168.7
我正在使用 Airflow v1.9rc5 中的 sftp_operator。我试图通过 SFTP 获取两个文件,但我得到: 错误 - 无法连接到主机:192.168.56.101,错误:没有可用的身
我想将 .png 文件从我计算机上的目录传输到远程服务器上的目录。 我必须使用 SFTP 来保护文件和传输模式。而且我已经有一个 UNIX 脚本 (.ksh) 文件以正常模式复制文件。如何在 SFTP
我正在使用 JSch 作为 SFTP 客户端,现在由于某些安全限制,我需要启用被动模式。 但我找不到启用被动模式的方法。 有人可以告诉我该怎么做吗? 最佳答案 “被动模式”是 FTP 协议(proto
我在 DigitalOcean 上有一个 Droplet,并创建了 SSH key 。我的 SSH 和 SFTP 访问与 Mac OSX 终端和传输完美配合。 但由于某种原因,SFTP 无法与 PHP
最近,我正在使用 SharpSSH 来处理远程文件。 SharpSSH 提供了用于删除远程目录的 rmdir API,但我发现当目录不为空时它会抛出异常并显示消息“Permission denied”
尝试通过 SFTP 连接到另一个集群中的文件,但没有任何效果。 Current spark version is : '2.2.0.2.6.4.0-91 . scala :2.11.8' . 下面是数
我已经使用 Package Installer (control+shift+p) 安装了 SFTP,但是现在当我点击“添加新服务器”时,无论我是哪个文件,它都只是添加了代码/json,我必须输入我的
我使用 DSL 配置和 spring。 我的路线如下: @Component public class UploadRoutesDefinition extends RouteBuilder {
我是一名优秀的程序员,十分优秀!