canonical / canonical/cloud-init

update user password fails when machine does not have openssh installed

Open
#3,802 1 comment 0 reactions 0 assignees View on GitHub
bug launchpad
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: #1901761](https://bugs.launchpad.net/cloud-init/+bug/1901761)

Launchpad details

affected_projects = []

assignee = None
assignee_name = None
date_closed = None
date_created = 2020-10-27T20:15:44.000418+00:00
date_fix_committed = None
date_fix_released = None
id = 1901761
importance = low
is_complete = False
lp_url = https://bugs.launchpad.net/cloud-init/+bug/1901761
milestone = None
owner = lamoura
owner_name = Lucas Albuquerque Medeiros de Moura
private = False
status = triaged
submitter = lamoura
submitter_name = Lucas Albuquerque Medeiros de Moura
tags = []
duplicates = []

_Launchpad user **Lucas Albuquerque Medeiros de Moura(lamoura)** wrote on 2020-10-27T20:15:44.000418+00:00_

When creating a machine with the following userdata:

```
#cloud-config
chpasswd:
list: |
ubuntu:passw0rd
ssh_pwauth: True
```

cloud-init will fails if the machine does not have openssh installed on it. That happens because pasasword module will try to run the following command:

```
service ssh restart
```

Which will fail if the machine does not have openssh installed.

How to reproduce:

Just launch an lxd vm with the provided userdata using the following image as base: `images:ubuntu/16.04/cloud`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.