Xamarin.配对至Mac.不支持键"OPENSSH" [英] Xamarin. Pair to Mac. Key 'OPENSSH' is not supported

查看:135
本文介绍了Xamarin.配对至Mac.不支持键"OPENSSH"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试连接Mac时,出现此错误.

When I try to connect my Mac, then I get this error.

我在哪里找到了日志:

System.NotSupportedException: Key 'OPENSSH' is not supported.
at Renci.SshNet.PrivateKeyFile.Open(Stream privateKey, String passPhrase)
at Renci.SshNet.PrivateKeyFile..ctor(String fileName, String passPhrase)
at Xamarin.Messaging.Ssh.MessagingAuthenticationMethod.InitializePrivateKeyAuthentication(String username, ISshInformationProvider sshInformationProvider) in E:\A\_work\157\s\External\messaging\src\Xamarin.Messaging.Ssh\MessagingAuthenticationMethod.cs:line 76
at Xamarin.Messaging.Ssh.MessagingService.GetMessagingConnection(Func`1 passwordProvider, ISshInformationProvider sshInformationProvider) in E:\A\_work\157\s\External\messaging\src\Xamarin.Messaging.Ssh\MessagingService.cs:line 418
at Xamarin.Messaging.Ssh.MessagingService.<ConnectAsync>d__64.MoveNext() in E:\A\_work\157\s\External\messaging\src\Xamarin.Messaging.Ssh\MessagingService.cs:line 167

我找到了它正在使用的库和代码: https://github.com/sshnet/SSH.NET/blob/bd01d971790a7c1fa73bad35b79ada90bf69e62d/src/Renci.SshNet/PrivateKeyFile.cs#L190

I found library and code that it's using: https://github.com/sshnet/SSH.NET/blob/bd01d971790a7c1fa73bad35b79ada90bf69e62d/src/Renci.SshNet/PrivateKeyFile.cs#L190

与OpenSSH无关,没有keyName.

and there is nothing about OpenSSH like a keyName.

我检查文件夹%LOCALAPPDATA%\ Xamarin \ MonoTouch中的私钥:

I check my private keys in folder %LOCALAPPDATA%\Xamarin\MonoTouch:

-----BEGIN OPENSSH PRIVATE KEY-----
...
-----END OPENSSH PRIVATE KEY-----

当我重新安装Windows 10和Visual Studio 2017而不是Windows 7时,我开始收到此错误

I began to receive this error when I reinstalled Windows 10 and Visual Studio 2017 instead of Windows 7

请帮助我解决问题

推荐答案

我在命令提示符下执行以下命令,然后重试连接Mac.

I execute below command in command-prompt, and retry connecting Mac.

ssh-keygen -t rsa -b 8192 -N "" -f "%LOCALAPPDATA%\Xamarin\MonoTouch\id_rsa"

-t指定加密类型'RSA'

-t specifies encryption type 'RSA'

-b使用8192位密钥

-b use 8192-bit key

-N明确指定空密钥短语

-N explicitly specifies empty keyphrase

这篇关于Xamarin.配对至Mac.不支持键"OPENSSH"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆