8000 Windows下无法使用`IdentityAgent`登录 · Issue #123 · trzsz/trzsz-ssh · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Windows下无法使用IdentityAgent登录 #123

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

Closed
lifei opened this issue Jun 28, 2024 · 11 comments
Closed

Windows下无法使用IdentityAgent登录 #123

lifei opened this issue Jun 28, 2024 · 11 comments

Comments

@lifei
Copy link
lifei commented Jun 28, 2024

ssh_config

Host s0* t0* x0*
    IdentityAgent /tmp/.ssh-agent.sock
    #!!IdentityAgent C:\Users\lifei\AppData\Local\Temp\.ssh-agent.sock

行为

> tssh t001
dial tcp [192.168.196.114:22] failed: dial tcp 192.168.196.114:22: i/o timeout
@lifei
Copy link
Author
lifei commented Jun 28, 2024

Warning: forward to agent [C:\Users\lifei\AppData\Local\Temp.ssh-agent.sock] failed: open C:\Users\lifei\AppData\Local\Temp.ssh-agent.sock: The process cannot access the file because it is being used by another process.

@lonnywong
Copy link
Member

Windows 用 named pipe 的,一般不需要配置 IdentityAgent ,会默认连接 \\.\pipe\openssh-ssh-agent,你用的是 openssh 的 ssh agent ,还是其他的?

@lifei
Copy link
Author
lifei commented Jun 28, 2024

使用的ssh-pageantpageant

@lifei
Copy link
Author
lifei commented Jun 28, 2024

测了下ssh-agent好像是OK的

@lonnywong
Copy link
Member

putty 的 pageant ?只要打开它,不要配置 IdentityAgent,自动就会连上它,你可以加 --debug 参数确认。

@lifei
Copy link
Author
lifei commented Jun 28, 2024

image
image

@lifei
Copy link
Author
lifei commented Jun 28, 2024

debug: dial ssh agent [C:/Users/lifei/AppData/Local/Temp/ssh-STmq6S4ntPtr/agent.996] failed: The parameter is incorrect.

@lifei
Copy link
Author
lifei commented Jun 28, 2024

putty 的 pageant ?只要打开它,不要配置 IdentityAgent,自动就会连上它,你可以加 --debug 参数确认。

不配OK……

@lonnywong
Copy link
Member

优先使用 ssh-agent,要关了它,才会尝试 pageant,不要配置任何 IdentityAgent。

@lonnywong
Copy link
Member
lonnywong commented Jun 29, 2024

Windows 一般不需要配置 IdentityAgent,如果要配置,也一般配置一个 Named Pipes,中文叫 命名管道

  • 例如 openssh ssh-agent 的命名管道是 \\.\pipe\openssh-ssh-agent( 不配置的话也会默认尝试连接它 ):

    Host xxx
        IdentityAgent \\.\pipe\openssh-ssh-agent
    
  • 对于 putty pageant,是没有命名管道的。如果打开了 pageant,没有配置 IdentityAgent,并且 ssh-agent 没有启动,tssh 会默认尝试连接 pageant。如果要配置 tssh 优先使用 pageant,可以如下配置(不是很建议,因为这不是一个真实的地址,只是 tssh 自定义的一个标识):

    Host xxx
        #!! IdentityAgent using_pageant_as_ssh_agent
    

@lonnywong
Copy link
Member

发现 Windows 也是支持 unix socket 的:

https://devblogs.microsoft.com/commandline/af_unix-comes-to-windows/

https://go-review.googlesource.com/c/sys/+/132555

我在下个版本支持一下,不过要求 ssh agent 自身要正确监听对应的 unix socket 。

638F

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
0