juju add-ssh-key allows keys with new lines in comment, key then cannot be removed

Bug #2057686 reported by Alastair Flynn
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
Medium
Alastair Flynn

Bug Description

You can add ssh keys with a newline in the comment:
juju boostrap lxd
juju add-model default
juju add-ssh-key "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAB36uxrTtfdEhfgN5d2P6dt2C3m64t3pBvkn54MFUrw line1
 key-label-after-newline"
The two lines are added as separate keys and the second line is not validated. If it is not a valid ssh key the it is impossible to remove from the model config.

This was originally reported as a bug on the terraform client: https://github.com/juju/terraform-provider-juju/issues/363

Changed in juju:
status: New → In Progress
milestone: none → 3.3.5
assignee: nobody → Alastair Flynn (aflynn50)
importance: Undecided → Medium
description: updated
Changed in juju:
status: In Progress → Fix Committed
Changed in juju:
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.