coreos / coreos/ignition

Unable to automatically set up `/etc/subuid` and `/etc/subgid` for new user

Open
#2,269 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

butane
Dominant language
Go
Stars
974
Forks
296
Avg merge
6d 14h
Merged PRs (30d)
9

Description

Created originally in Butane by @mogeko: https://github.com/coreos/butane/issues/494


I'm using Butane to deploy a Fedora CoreOS.

I want to create a non-privileged user (nonroot) specifically to run the Podman container.

But it seems that Butane did not set /etc/subuid and /etc/subgid for him:

variant: fcos
version: 1.5.0

passwd:
  groups:
    - name: nonroot
      gid: 65532
  users:
    - name: mogeko
      gecos: Mogeko
      ssh_authorized_keys:
        - ssh-rsa ...
      groups:
        - wheel
        - sudo
    - name: nonroot
      gecos: Unprivileged User
      uid: 65532
      primary_group: nonroot
      no_log_init: true
      shell: /sbin/nologin

# ...
$ id
uid=1001(mogeko) gid=1001(mogeko) groups=1001(mogeko),10(wheel),16(sudo) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023

$ sudo --user=nonroot id
uid=65532(nonroot) gid=65532(nonroot) groups=65532(nonroot) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023

$ cat /etc/subuid
core:524288:65536
mogeko:589824:65536

$ cat /etc/subgid
core:524288:65536
mogeko:589824:65536

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the passwd.users configuration shown in the issue and trace how Ignition provisions new users on Fedora CoreOS. Check how /etc/subuid and /etc/subgid are currently handled for created users, then verify that the requested nonroot user receives appropriate entries and that existing behavior remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, linux
Domain
operating-systems
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.