r2286 breaks bootstrap with authorized-keys in env.yaml

Bug #1275657 reported by Curtis Hovey
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
juju-core
Fix Released
Critical
Andrew Wilkins

Bug Description

With juju-core r2286, all tests juju bootstraps that embeds the ssh keys in the yaml using authorized-keys fail. Tests that use authorized-keys-path work as does environments that fall back id_rsa can bootstrap.

Related branches

Curtis Hovey (sinzui)
Changed in juju-core:
assignee: nobody → Andrew Wilkins (axwalk)
milestone: none → 1.18.0
Andrew Wilkins (axwalk)
Changed in juju-core:
status: Triaged → In Progress
Revision history for this message
Andrew Wilkins (axwalk) wrote :

Does the client machine still specify the identity to use in ~/.ssh/config? Maybe -i *does* override that, but not the defaults.

Curtis Hovey (sinzui)
Changed in juju-core:
milestone: 1.18.0 → 1.17.3
Revision history for this message
Curtis Hovey (sinzui) wrote :

The jenkins users does not have an ,/ssh/config. Jenkins has two pairs of keys, the default key are used as jenkins to manages its access. The staging keys are used by juju and within tests.

Revision history for this message
Andrew Wilkins (axwalk) wrote :

How did that ever work? The staging key must be communicated to the ssh client somewhere (authorized-key only affects the server). Are the keys loaded into Jenkins, and Jenkins loads them into the ssh-agent before calling the build script?

authorized-key-path and id_rsa fallback will *always* work, provided the target host doesn't require proxying: authorized-key-path is combined with the ~/.juju/ssh public keys (whereas authorized-keys is taken verbatim), so one of the auto-generated ssh keys will be used as a fallback; id_rsa is always tried by ssh.

Revision history for this message
Andrew Wilkins (axwalk) wrote :

Forgot to add: I can't reproduce the problem. I can bootstrap Canonistack just fine. I have the identity specified in my ~/.ssh/config, and I put its public key in the authorized-keys attribute.

Revision history for this message
Andrew Wilkins (axwalk) wrote :

What workaround did you implement in lp:1257371? From the last two comments, I think you symlinked ~/.ssh/id_rsa to point to your staging key. Is that correct? If that's correct, then I think I know what the problem is.

I understood ssh to always attempt ~/.ssh/id_[dr]sa, but that's not true. The '-i' flag overrides the defaults, but ssh will also try whatever's held in the ssh-agent. In your case, there is no agent (or it doesn't have the keys loaded). In my testing, I always had my default keys loaded into the agent.

I'll have a fix ready shortly.

Andrew Wilkins (axwalk)
Changed in juju-core:
status: In Progress → Fix Committed
Revision history for this message
Curtis Hovey (sinzui) wrote :

Thank you Andrew. your branch indeed fixed the CI issue.

Curtis Hovey (sinzui)
Changed in juju-core:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.