Adding and reporting ssh keys fails for user in extrausers
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Expired
|
Medium
|
Unassigned |
Bug Description
If a user is added with '--extrausers' (which happens on ubuntu core)
then adding ssh keys or reporting which keys are added will fail as the users cannot be found.
This seems a general issue as extrausers, see bug 1679765.
The stack trace looks like:
2017-04-04 16:57:00,117 - util.py[WARNING]: Applying ssh credentials failed!
2017-04-04 16:57:00,117 - util.py[DEBUG]: Applying ssh credentials failed!
Traceback (most recent call last):
File "/usr/lib/
apply_
File "/usr/lib/
ssh_
File "/usr/lib/
(ssh_dir, pwent) = users_ssh_
File "/usr/lib/
pw_ent = pwd.getpwnam(
KeyError: 'getpwnam(): name not found: ubuntu'
and then
2017-04-04 16:57:04,559 - util.py[WARNING]: Running module ssh-authkey-
2017-04-04 16:57:04,560 - util.py[DEBUG]: Running module ssh-authkey-
Traceback (most recent call last):
File "/usr/lib/
freq=freq)
File "/usr/lib/
return self._runners.
File "/usr/lib/
results = functor(*args)
File "/usr/lib/
(key_fn, key_entries) = ssh_util.
File "/usr/lib/
(ssh_dir, pw_ent) = users_ssh_
File "/usr/lib/
pw_ent = pwd.getpwnam(
KeyError: 'getpwnam(): name not found: ubuntu'
Related bugs:
* bug 1679765: cannot lock password for user created with useradd --extrausers
Changed in cloud-init: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
Tracked in Github Issues as https:/ /github. com/canonical/ cloud-init/ issues/ 2851