DKW*_*Woo 4 ssh ubuntu jsch gradle
I recently changed my cloud server OS from Ubuntu 20.04 to 22.04. After that, remote upload jar task fail during gradle build using org.hidetake.ssh with below message.
com.jcraft.jsch.JSchException: Auth fail
I guess it could be a RSA problem which is deprecated on Ubuntu 22.04 but I can't find how to resolve it.
The config I'm used with ssh.run task is below. I would really appreciate if anyone has idea.
remotes {
myServer {
host = 'x.x.x.x'
port = 22
user = 'ubuntu'
identity = file('d:/a.pem')
knownHosts = allowAnyHosts
}
}
Run Code Online (Sandbox Code Playgroud)
确实很有可能服务器需要rsa-sha2。 JSch 不支持它。由于 JSch 似乎不再更新,它很可能永远不会更新。
JSch 的一个分支可以做到这一点: https:
//github.com/mwiede/jsch
rsa-sha2另一个(显然不太安全)选项是通过将deprecated ssh-rsa添加到 来重新配置服务器,使其不再需要PubkeyAcceptedAlgorithms.
| 归档时间: |
|
| 查看次数: |
1816 次 |
| 最近记录: |