Score:0

Useradd Default Groups in 22.04

jo flag

I'm working on building some new servers with 22.04. I use Ansible to create users, and noticed that when creating a new user, for example "test", the user's default group is now the "users" group. On 20.04, a user "test" would automatically create a group named "test". It looks like Ansible's user module is just using the "useradd" command. In 20.04, if I run useradd test, test would be in the test group. If I run it on 22.04, test is in the users group. Is there a way for me to change the behavior of useradd to behave more like 20.04 in 22.04?

hr flag
Do the two systems have different values of `USERGROUPS_ENAB` in their /etc/login.defs files?
spikeypanda48 avatar
jo flag
It appears that its set to "yes" on the 20.04 system, and "no" on the 22.04 system. Sounds like that might be the cause
hr flag
... indeed, see `man useradd`
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.