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

ssh: handshake failed #47

Closed
dwarfi09 opened this issue Dec 7, 2022 · 7 comments
Closed

ssh: handshake failed #47

dwarfi09 opened this issue Dec 7, 2022 · 7 comments
Labels
question Further information is requested

Comments

@dwarfi09
Copy link

dwarfi09 commented Dec 7, 2022

sake ssh remote-server
works as expected

sake exec 'ls' -s remote-server
for the same server returns an error: "ssh: handshake failed: ssh: unable to authenticate, attempted methods [none], no supported methods remain"

A remote command with plain ssh works:
ssh user@remote-server "ls"

Any hint why the connection fails if I try to execute a cmd via sake?

@dwarfi09 dwarfi09 added the question Further information is requested label Dec 7, 2022
@alajmo
Copy link
Owner

alajmo commented Dec 7, 2022

One note, sake ssh uses the users underlying ssh whereas run/exec uses Go's ssh library.
Anyway, how do you connect to the server? See https://sakecli.com/inventory#provide-identity-and-password-credentials for more info on connection methods.

@dwarfi09
Copy link
Author

dwarfi09 commented Dec 7, 2022

OK, thank you. So I have to provide the path to the identity_file explicitly. This works, great!

@alajmo
Copy link
Owner

alajmo commented Dec 7, 2022

sake will try all identities in your ssh-agent (just like ssh does, unless you specify IdentitiesOnly) if you don't specify any identity key.

@dwarfi09
Copy link
Author

dwarfi09 commented Dec 7, 2022

Maybe sake could try the default .ssh/id_rsa if no ssh-agent is used (like ssh does)?

@alajmo
Copy link
Owner

alajmo commented Dec 7, 2022

Yeah, that's a good idea, I'll also try to support the Match * operator since it's quite common to specify some common options there.

@alajmo
Copy link
Owner

alajmo commented Jan 4, 2023

0.14.0 should now support default path ~/.ssh/id_rsa, ~/.ssh/id_ecdsa, ~/.ssh/id_dsa if no identity file is set.

@alajmo alajmo closed this as completed Jan 4, 2023
@dwarfi09
Copy link
Author

dwarfi09 commented Jan 6, 2023

works very well, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants