#!/bin/bash # 创建 testgroup groupadd testgroup # 创建 testuser useradd testuser # 将用户加入组,即更改用户属性 usermod -aG testgroup testuser # 验证 id testuser