canonical / canonical/cloud-init
users module does not allow ssh_import_id and ssh_authorized_keys at the same time
- Dominant language
- Python
- Stars
- 3.8k
- Forks
- 1.1k
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 18
Description
This bug was originally filed in Launchpad as [LP: #1997588](https://bugs.launchpad.net/cloud-init/+bug/1997588)
Launchpad details
affected_projects = []
assignee = None
assignee_name = None
date_closed = None
date_created = 2022-11-23T18:01:01.031774+00:00
date_fix_committed = None
date_fix_released = None
id = 1997588
importance = medium
is_complete = False
lp_url = https://bugs.launchpad.net/cloud-init/+bug/1997588
milestone = None
owner = nrobinaubertin
owner_name = Niels Robin-Aubertin
private = False
status = triaged
submitter = nrobinaubertin
submitter_name = Niels Robin-Aubertin
tags = []
duplicates = []
_Launchpad user **Niels Robin-Aubertin(nrobinaubertin)** wrote on 2022-11-23T18:01:01.031774+00:00_
I'm on ubuntu 22.04, using multipass 1.10.1 with a cloud-init file to instanciate a simple server:
```yaml
users:
- name: ubuntu
ssh_authorized_keys:
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOkF+W1ETkZQr5PWhcugCVh3aSyNDFTYQRRblh7prGXN
ssh_import_id:
- lp:nrobinaubertin
```
I launch the instance with:
```shell
multipass launch -n simple_instance -d 10G -m 1G -c 1 --cloud-init cloud-init.yaml 22.04
```
And I check the authkeys file with:
```shell
multipass exec simple_instance -- cat /home/ubuntu/.ssh/authorized_keys
```
The key from `ssh_authorized_keys` is there but not the one from `ssh_import_id`.
From the documentation website and the examples given [here](https://cloudinit.readthedocs.io/en/latest/topics/examples.html) I would expect both keys to be present.
Contributor guide
Assessment
This issue has not been assessed yet.