简体   繁体   English

使用apache vfs与相互身份验证进行sftp

[英]sftp with mutual auth using apache vfs

We're trying to sftp to a server that requires mutual authentication. 我们正在尝试通过sftp到需要相互身份验证的服务器。 We need to do this programmatically in java. 我们需要在Java中以编程方式执行此操作。

Is there a way to use mutual authentication (client certificates) with apache vfs when connecting to an SSH server? 连接到SSH服务器时,是否可以通过apache vfs使用相互身份验证(客户端证书)?

I'm not sure what you mean by mutual authentication . 我不确定您所说的相互认证是什么意思。 All SSH sessions involve authenticating both the identity of the server to the client and vice versa. 所有SSH会话都涉及向客户端验证服务器的身份,反之亦然。 I do know that Commons-VFS uses JSCH for its underlying SSH layer and you can use both password and publickey authentication with JSCH (and therefore with Commons-VFS). 我确实知道Commons-VFS使用JSCH作为其底层SSH层,并且您可以同时使用JSCH的密码公钥身份验证(因此可以使用Commons-VFS)。 In addition, JSCH supports GSS-API for authentication, presumably to support additional auth mechanisms that aren't directly supported, but I don't see any way of using this through VFS, nor do I see any direct support in JSCH or Commons VFS for certificate based authentication . 另外,JSCH支持GSS-API进行身份验证,大概支持不直接支持的其他身份验证机制,但是我看不到通过VFS使用此身份验证的任何方式,也看不到JSCH或Commons VFS中的任何直接支持用于基于证书的身份验证 This class has all the SFTP specific options you can set on a file system provider in Commons VFS, and this page has all of the JSCH information, which will give you more flexibility in setting SFTP options but less homogeneity in your code if you're using other types of VFS filesystems as well. 此类包含您可以在Commons VFS中的文件系统提供程序上设置的所有SFTP特定选项,并且此页面包含所有JSCH信息,这将使您在设置SFTP选项时更具灵活性,但如果您使用也使用其他类型的VFS文件系统。

If none of that satisfies, you can wait for Java 7 which will have pluggable file system providers and I'm sure someone will write a nice SFTP provider in short order after that comes out. 如果这些都不满足,您可以等待Java 7,它将具有可插拔的文件系统提供程序,并且我敢肯定,有人问世之后不久就会有人写出一个不错的SFTP提供程序。

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

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