简体   繁体   English

Android和JSch:另一台SSH服务器后面的SSH

[英]Android and JSch: SSH behind another SSH server

I'm trying to access a server behind another server within an Android app. 我正在尝试访问Android应用程序中另一台服务器后面的服务器。 I can get into the first server and do things like edit files and upload/download. 我可以进入第一台服务器并执行诸如编辑文件和上载/下载之类的操作。 The problem is getting into the second server via ssh using rsa keys. 问题是使用rsa密钥通过ssh进入第二台服务器。 The thing is, as a stand alone program compiled on my pc everything works fine, that is I could access the second server and do everything I could on the first. 事实是,作为在我的PC上编译的独立程序,一切正常,也就是说,我可以访问第二台服务器,并在第一台服务器上可以做的所有事情。 When I try to implement it into my Android app, I can't get into the second server, only the first one. 当我尝试将其实现到我的Android应用程序中时,我无法进入第二台服务器,只能进入第一台服务器。 I get a JSch error: Auth Fail when I try, even though I am using the same keys, and I'm sure I am doing things like I did before on my pc. 我收到一个JSch错误:尝试时,即使我使用相同的密钥,身份验证也会失败,并且我确定自己的操作与以前在PC上所做的一样。 Is this a limitation on Android? 这是对Android的限制吗? Is there a work-around? 有解决方法吗? I've used port 22 for both the first and second server, since it worked before, if that is relevant. 我已经在第一台和第二台服务器上使用了端口22,因为它以前曾工作过(如果有的话)。

因此,事实证明,出于安全目的,这是对服务器的限制...我必须制作一个RESTful Web应用程序才能与第二台服务器通信。

您必须使用JSch.addIdentity方法之一,请参阅类似的帖子: JSch:如何使用ssh-keys ssh进入服务器

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM