Possible issue with IPv6 client connecting to an iPv4 host
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 25/100
- Issue 类型
- 功能
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- csharp
- 领域
- networking
调研方向
从最小的 C# 复现以及报告中提到的连接入口 SshClient.Connect 和 SftpClient 开始。在启用和禁用 IPv6 的情况下进行复现,将连接行为与终端 SSH 客户端进行比较,并确定是否定义了 IPv4-only 选项。当所需行为和配置界面已记录,或由经过验证的测试提供支持时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
TL;DR; Connections only work if I disable IPv6 on local machine. Client may accept IPv6 connections, but I can only whitelist IPv4 addresses. Can I force SSH.NET to use IPv4 only?
Hey,
I started working on an old project again where an app would connect to a remote server to transfer some files. I could not connect to my remote test servers, connection would time out. I reduced the example right down to the following,
var sshClient = new SshClient(Host, Port, Username, Password);
sshClient.ErrorOccurred += (sender, e) =>
{
Debugger.Break();
};
sshClient.HostKeyReceived += (sender, eventArgs) =>
{
Debugger.Break();
};
sshClient.ServerIdentificationReceived += (sender, eventArgs) =>
{
Debugger.Break();
};
sshClient.Connect();
Debugger.Break();
If I took the credentials I can manually SSH to the server without issues.
ssh User@Host -p PORT
< input password
I have the issue across both my macOS and Windows machines here. Wondering if remote servers had changed I asked friend to try and they have no issues at all.
Remote host makes me input an IP address to whitelist my client machine. It only accepts IPv4 addresses, I tried an IPv6 address but it rejected it. If I disable IPv6 (tested on Windows by disabling in control panel) my connections work right away. So I think what is happening here is the host accepts an IPv6 connection but with no way to whitelist it I can't connect. I assume because the host accepts the IPv6 connection it won't attempt to fallback to IPv4. But if this is the case I don't understand why Terminal connects fine. I tried verbose output with ssh but I couldn't see any IPv4/6 things happening.
If I can confirm host accepts IPv6 connections I'll request they allow adding IPv6 whitelists which should solve the problem (at least on this host)
Is it possible to force SshClient and SftpClient use IPv4 if even if IPv6 is available?
- 主要语言
- C#
- 星标
- 4.4k
- 派生
- 993
- 平均合并
- 9 天 21 小时
- 30 天内合并 PR
- 1
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
sshnet/SSH.NET 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 62/100
-
难度 3/5 1-2 天 新手友好度 68/100
-
难度 4/5 3-5 天 新手友好度 48/100
-
难度 3/5 1-2 天 新手友好度 67/100
-
难度 4/5 3-5 天 新手友好度 55/100
相似的 Issue
-
untriaged
难度 1/5 1 小时以内 新手友好度 88/100
dotnet/dotnet-api-docs#13095 ·
-
area-deployment area-integrations triage:bot-seen
难度 2/5 半天 新手友好度 86/100
-
type/automation type/tech-debt
难度 2/5 1-3 小时 新手友好度 84/100
-
bug
难度 1/5 1 小时以内 新手友好度 90/100
newrelic/newrelic-dotnet-agent#3850 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 88/100
LuckyPennySoftware/AutoMapper#4660 ·