Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xshell 服务器发送了一个无效的主机密钥 #2

Closed
maikebing opened this issue Dec 13, 2017 · 4 comments
Closed

xshell 服务器发送了一个无效的主机密钥 #2

maikebing opened this issue Dec 13, 2017 · 4 comments

Comments

@maikebing
Copy link

如题

@Aimeast
Copy link
Owner

Aimeast commented Dec 14, 2017

请补充具体的使用场景。用的什么客户端,如何连接的,启用了什么服务。

@maikebing
Copy link
Author

由于行业和采购原因, 我只能使用windows, 我想通过这个工具在我的软件集成ssh 服务端, 便于我维护护,我试图通过密钥的连接。 用的 是xshell 。

@Aimeast
Copy link
Owner

Aimeast commented Dec 14, 2017

FxSsh是针对Git服务端场景设计的,实现了SSH架构中的exec服务。连接xshell需要服务端提供shell服务支持,目前FxSsh还没有实现shell终端功能。

可以参考我当时写的文章了解SSH架构:http://www.cnblogs.com/Aimeast/p/4584540.html

如有兴趣,可以从这里入手,实现shell服务。

private void HandleMessage(ChannelRequestMessage message)
{
switch (message.RequestType)
{
case "exec":
var msg = Message.LoadFrom<CommandRequestMessage>(message);
HandleMessage(msg);
break;
default:
if (message.WantReply)
_session.SendMessage(new ChannelFailureMessage
{
RecipientChannel = FindChannelByServerId<Channel>(message.RecipientChannel).ClientChannelId
});
throw new SshConnectionException(string.Format("Unknown request type: {0}.", message.RequestType));
}
}

PS: exec服务和shell服务非常类似,在此基础上只用很少的代价就可实现shell服务。

@maikebing
Copy link
Author

好。 感谢。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants