You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

添加用户时提示“useradd: group '100' does not exist”错误求助

Fixing "useradd: group '100' does not exist" Error

Hey there, let's break down what's going on here and fix that useradd error you're seeing.

The Root Cause

The error pops up because your /etc/default/useradd file is configured to use GROUP=100 as the default primary group for new users—but this group (with GID 100) no longer exists on your system. Since you mentioned creating, modifying, and deleting users/groups previously, it’s likely you accidentally removed the group assigned to GID 100 at some point.

When useradd can’t locate the group specified in that default config, it throws the "group '100' does not exist" error and ignores the GROUP= setting, which explains the second message you’re seeing.

Step-by-Step Fixes

Here are two straightforward ways to resolve this:

Option 1: Recreate the GID 100 group

First, confirm the group is truly gone by running:

cat /etc/group | grep ":100:"

If you get no output, the group doesn’t exist. Recreate it with:

sudo groupadd -g 100 default-users

You can replace default-users with whatever name you want (maybe the original name of the group you deleted, if you remember it).

Option 2: Update the default GROUP setting to an existing group

  1. First, list all existing groups to pick a valid one:
cat /etc/group

Look for a group you want to use as the default (the test group you mentioned in your command is a good candidate if it still exists).

  1. Edit the /etc/default/useradd file with your preferred editor (like nano):
sudo nano /etc/default/useradd

Change the line GROUP=100 to either:

  • The name of an existing group: GROUP=test
  • Or the GID of an existing group (find it in the /etc/group output—it’s the third field separated by colons)
  1. Save the file (in nano, press Ctrl+O, then Enter, then Ctrl+X to exit).

Verify the Fix

Once you’ve done either option, test creating a user again:

sudo useradd anyuser

This should run without errors now. If you want to clean up, you can delete the test user with sudo userdel anyuser.

内容的提问来源于stack exchange,提问作者Riz

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.06 10:12:45