How to read the SSH key-sig pair banner (for generating SSH password) after connecting to host in Java?

夙愿已清 提交于 2019-12-01 12:55:52

The message (which you call "SSH key-sig pair banner") can come either as an SSH authentication banner or as an SSH keyboard interactive authentication prompt. It cannot be a password authentication prompt, as that is not customizable by an SSH server.

In both cases, to capture the message, implement the UserInfo interface. And associate it with the Session instance using the Session.setUserInfo method.


To quickly test how the server is sending the message, try to connect with WinSCP SFTP client and check how it displays the message.

  • as a banner:

  • or as a keyboard interactive prompt?

    The "Server Prompt" in the title is what you get in the name. The instruction would be rendered below the "Using keyboard-interactive authentication" (there are no "instructions" on this prompt). And the "The challenge is ..." is the prompt[0] (there's just one "prompt" in this case, but there can be more).

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!