You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
733 B
Markdown

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

---
icon: edit
date: 2022-12-02
category:
- 系统配置
- Linux
headerDepth: 5
---
# centos7 更改用户组
```这里都是root权限下执行你也可以加上sudo```
```shell
cat /etc/group
```
或者使用管道直接选出是否docker
```shell
cat /etc/group grep docker
```
如果出现docker就不用添加有时会出现dockerroot没做研究我也添加docker用户组。
第二步添加docker用户组
```shell
groupadd docker
```
也可以指定用户组id修改id就可以不要和第一个查出来的id重复
```shell
groupadd -g id docker
```
第三步把普通用户添加docker用户组
```shell
gpasswd -a 普通用户名 docker
```
第四 更新用户组
```shell
newgrp docker
```