alexellis / alexellis/k3sup

Support SSH agent authentication on Windows

Aberta
#463 1 comentário 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
Go
Estrelas
7.4k
Forks
430
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

**What do you want?**

Allow `k3sup install` and other SSH-based commands to use keys loaded in the Windows OpenSSH Authentication Agent, as they already do on Linux and macOS.

**Why do you want this?**

On Windows, k3sup currently skips SSH-agent authentication and falls back to the default private-key path. This fails when the key is available through the Windows SSH agent but no `~/.ssh/id_rsa` file exists.

Supporting the Windows agent would also avoid requiring users to hardcode a private-key path with `--ssh-key`.

**Recommended solution**

Use `github.com/Microsoft/go-winio` to connect to the standard Windows OpenSSH agent named pipe:

`\\.\pipe\openssh-ssh-agent`

Pass the resulting `net.Conn` to the existing `golang.org/x/crypto/ssh/agent` authentication flow. If the agent is unavailable or authentication fails, retain the existing private-key fallback.

**Additional context**

I implemented and tested this against the built-in Windows OpenSSH Authentication Agent. k3sup successfully authenticated to a remote Ubuntu server and installed K3s without `--ssh-key` or a default `~/.ssh/id_rsa` file.

While implementing this, I also found that the existing SSH-agent connection was not closed. The proposed change makes its lifecycle explicit: the connection is closed after a failed agent authentication attempt before falling back to a private key, and when the successful SSH operator is closed. A regression test covers the failure and fallback path.

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.