[GH-ISSUE #673] special characters incorrectly passed to exe(KiTTY, WinSCP) #3468

Closed
opened 2026-03-13 11:35:32 +03:00 by kerem · 3 comments
Owner

Originally created by @wyx176 on GitHub (Jun 4, 2024).
Original GitHub issue: https://github.com/1Remote/1Remote/issues/673

Originally assigned to: @VShawn on GitHub.

初步排查了下 是好像是密码问题这种密码就连接不了
2020aA+66
多次测试是+号导致的,通过cmd启动时候需要把+号转义成%2B这个就能连接了
原始错误:sftp://root:2020aA+66@127.0.0.1:22/
正确示例:sftp://root:2020aA%2B66@127.0.0.1:22/

但是转义之后ssh就提示密码错误了,sftp不转义不能连接.....

参考URL特殊字符发现的

1、用的WinScp和XFTP都这样,密码像没有自动带到SFTP客户端。

image

2、协议配置如图

image

3、看了你下代码,我这样改了后就可以正常debug运行了,但是生成的Shawn.Utils.pdb文件复制过去后用不了,提示主机"root"不存在。C#玩不转.....
image

image

Originally created by @wyx176 on GitHub (Jun 4, 2024). Original GitHub issue: https://github.com/1Remote/1Remote/issues/673 Originally assigned to: @VShawn on GitHub. 初步排查了下 是好像是密码问题这种密码就连接不了 2020aA+66 多次测试是+号导致的,通过cmd启动时候需要把+号转义成%2B这个就能连接了 原始错误:sftp://root:2020aA+66@127.0.0.1:22/ 正确示例:sftp://root:2020aA%2B66@127.0.0.1:22/ 但是转义之后ssh就提示密码错误了,sftp不转义不能连接..... 参考[URL特殊字符](https://blog.csdn.net/yiban9527/article/details/123134981)发现的 **1、用的WinScp和XFTP都这样,密码像没有自动带到SFTP客户端。** ![image](https://github.com/1Remote/1Remote/assets/32320103/38ffc376-bdd8-4b3d-91de-64753d4b1f0d) **2、协议配置如图** ![image](https://github.com/1Remote/1Remote/assets/32320103/e28e401c-e93f-4075-9ce1-9dc411ecd4bc) **3、看了你下代码,我这样改了后就可以正常debug运行了,但是生成的Shawn.Utils.pdb文件复制过去后用不了,提示主机"root"不存在。C#玩不转.....** ![image](https://github.com/1Remote/1Remote/assets/32320103/2788d40c-e30a-4280-b64b-55dd6ba5438e) ![image](https://github.com/1Remote/1Remote/assets/32320103/cdf53cc1-1f5c-4441-ab75-bea761f789ec)
kerem 2026-03-13 11:35:32 +03:00
Author
Owner

@VShawn commented on GitHub (Jun 7, 2024):

你改这里是不对的,我待会改一个版本给你测试一下

并且从你的测试结果推论,这些字符应当都需要转义

image

推论是错误的,WinSCP 使用密码 123456!@#$%^ 无需转义即可登陆成功。

于是找到资料:https://winscp.net/eng/docs/session_url#special

不确定该转义是否适用于 XFTP 等工具

<!-- gh-comment-id:2153617336 --> @VShawn commented on GitHub (Jun 7, 2024): 你改这里是不对的,我待会改一个版本给你测试一下 ~并且从你的测试结果推论,这些字符应当都需要转义~ ![image](https://github.com/1Remote/1Remote/assets/10143738/f29ee2f6-3672-4e4e-93e9-8199408e1980) 推论是错误的,WinSCP 使用密码 `123456!@#$%^` 无需转义即可登陆成功。 于是找到资料:https://winscp.net/eng/docs/session_url#special 不确定该转义是否适用于 XFTP 等工具
Author
Owner

@VShawn commented on GitHub (Jun 7, 2024):

@wyx176 劳烦下载最新的包,我测试密码中带空格的依然不行,其他情况都连接ok

<!-- gh-comment-id:2154847989 --> @VShawn commented on GitHub (Jun 7, 2024): @wyx176 劳烦下载最新的包,我测试密码中带空格的依然不行,其他情况都连接ok
Author
Owner

@wyx176 commented on GitHub (Jun 8, 2024):

@wyx176 劳烦下载最新的包,我测试密码中带空格的依然不行,其他情况都连接ok

测试了下 WinScp和Xftp都可以了 太强了

<!-- gh-comment-id:2155721737 --> @wyx176 commented on GitHub (Jun 8, 2024): > @wyx176 劳烦下载最新的包,我测试密码中带空格的依然不行,其他情况都连接ok 测试了下 WinScp和Xftp都可以了 太强了
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/1Remote#3468
No description provided.