canonical / canonical/cloud-init

System user cannot be created with a homedir

Open
#3,848 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: #1917135](https://bugs.launchpad.net/cloud-init/+bug/1917135)

Launchpad details

affected_projects = []

assignee = None
assignee_name = None
date_closed = None
date_created = 2021-02-27T12:58:59.498643+00:00
date_fix_committed = None
date_fix_released = None
id = 1917135
importance = undecided
is_complete = False
lp_url = https://bugs.launchpad.net/cloud-init/+bug/1917135
milestone = None
owner = jackenmen
owner_name = Jakub Kuczys
private = False
status = triaged
submitter = jackenmen
submitter_name = Jakub Kuczys
tags = []
duplicates = []

_Launchpad user **Jakub Kuczys(jackenmen)** wrote on 2021-02-27T12:58:59.498643+00:00_

While it is not typical, system users can be created with a home directory by passing `-m/--create-home` flag to the command along with `-r/--system` flag. This cannot be done currently as `system: true` option will forcefully add the `-M` flag to the command. I think that there should be some way to do this other than manually calling `useradd`. I was expecting that if I put `homedir: /home/homeassistant` explicitly in the cloud-config, it will work, but it is not enough:
```
#cloud-config
users:
- default
- name: homeassistant
gecos: Home Assistant
system: true
lock_passwd: true
homedir: /home/homeassistant
```

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.