Skip to content
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

[Feature Request] Encrypted SSH keys #8

Closed
HeavyHorst opened this issue Aug 18, 2019 · 8 comments · Fixed by #9
Closed

[Feature Request] Encrypted SSH keys #8

HeavyHorst opened this issue Aug 18, 2019 · 8 comments · Fixed by #9

Comments

@HeavyHorst
Copy link
Contributor

Current Behaviour

k3sup install --ip $IP --user root panics with

Public IP: xxx.xxx.xx.xx
ssh -i /home/rkaufmann/.ssh/id_rsa root@xxx.xxx.xx.xx
panic: ssh: cannot decode encrypted private keys

goroutine 1 [running]:
github.com/alexellis/k3sup/pkg/cmd.loadPublickey(0xc4200ba1a0, 0x1b, 0xc42005bbb0, 0x3)
	/home/alex/go/src/github.com/alexellis/k3sup/pkg/cmd/install.go:132 +0x136
github.com/alexellis/k3sup/pkg/cmd.MakeInstall.func1(0xc4200dc280, 0xc4200c0240, 0x0, 0x4, 0x0, 0x0)
	/home/alex/go/src/github.com/alexellis/k3sup/pkg/cmd/install.go:54 +0x445
github.com/alexellis/k3sup/vendor/github.com/spf13/cobra.(*Command).execute(0xc4200dc280, 0xc4200c0200, 0x4, 0x4, 0xc4200dc280, 0xc4200c0200)
	/home/alex/go/src/github.com/alexellis/k3sup/vendor/github.com/spf13/cobra/command.go:826 +0x468
github.com/alexellis/k3sup/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xc4200dca00, 0x0, 0xc4200dc780, 0xc4200dcb50)
	/home/alex/go/src/github.com/alexellis/k3sup/vendor/github.com/spf13/cobra/command.go:914 +0x306
github.com/alexellis/k3sup/vendor/github.com/spf13/cobra.(*Command).Execute(0xc4200dca00, 0xc42005bf60, 0x1)
	/home/alex/go/src/github.com/alexellis/k3sup/vendor/github.com/spf13/cobra/command.go:864 +0x2b
main.main()
	/home/alex/go/src/github.com/alexellis/k3sup/main.go:22 +0x145

Possible Solution

The Program could ask for the ssh key passphrase and use
signer, err := ssh.ParsePrivateKeyWithPassphrase(key, []byte("password")) instead of
signer, err := ssh.ParsePrivateKey(key)

@alexellis
Copy link
Owner

Derek set title: [Feature Request] Encrypted SSH keys

@derek derek bot changed the title panic: ssh: cannot decode encrypted private keys [Feature Request] Encrypted SSH keys Aug 18, 2019
@alexellis
Copy link
Owner

Thank you for your feature request 👍

@alexellis
Copy link
Owner

alexellis commented Aug 18, 2019

As a workaround you could generate a new key without its own password and use that with your remote host.

This is an error that people will only run into if they have encrypted their SSH key with an additional (optional) password.

if anybody lands here and has the same request please vote this feature up with a 👍

@gabrielsagnard
Copy link

👍

2 similar comments
@chrisludwig
Copy link

chrisludwig commented Aug 19, 2019

+1

@kaihoffman
Copy link

👍

@alexellis
Copy link
Owner

Hi everyone, please try out the latest release 0.2.3 with the changes submitted by @HeavyHorst in #9. Thank you Rene 👍

@tobru
Copy link

tobru commented Aug 21, 2019

I just tested 0.2.3 using my encrypted SSH key: It just works! Thank you very much, great addition.

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

Successfully merging a pull request may close this issue.

6 participants