-
Notifications
You must be signed in to change notification settings - Fork 25
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
Connection issue with keys #95
Comments
Yeah I think there's something messed up in the agent/keypath handling, but it has become such a bowl of spaghetti that it's very difficult to make any changes, so I'm slowly trying to simplify the logic and codebase in the v2 branch. You can just |
@kke I am happy to wait for v2. It's not a huge deal. Works well enough most of the time. 😅 |
@kke with the last I am building the connection like so: connection := rig.Connection{
SSH: &rig.SSH{
Address: nodeIP,
User: "core",
KeyPath: &publicKey,
Bastion: &rig.SSH{
Address: "IP.ADDRESS_HERE",
User: "bastion",
KeyPath: &publicKey,
},
},
} This used to work:
The trace log:
None of these keys should be enumerated on since I am setting |
I rebuild it with |
Yes something must be broken or could func (c *SSH) keypathsFromConfig() []string {
log.Tracef("%s: trying to get a keyfile path from ssh config", c)
...
}
// SetDefaults sets various default values
func (c *SSH) SetDefaults() {
c.once.Do(func() {
if c.KeyPath != nil && *c.KeyPath != "" {
if expanded, err := expandAndValidatePath(*c.KeyPath); err == nil {
c.keyPaths = append(c.keyPaths, expanded)
}
// keypath is explicitly set, accept the fact even if it's invalid and
// don't try to find it from ssh config/defaults
return // <--- it should get out here
}
c.KeyPath = nil
paths := c.keypathsFromConfig() // <--- this outputs the "trying to...."
....
} |
Hey 👋 - first off, wanted to say thanks for rig. I found it super nice to work with when I automated a couple checks.
There's one issue I ran into, when I try connecting the first time, it seems to expect the key to be loaded in the ssh-agent. So once I manually ssh in using the key it works.
Is there a way to not rely on the agent?
The text was updated successfully, but these errors were encountered: