linux-tutorial/codes/shell/系统管理/系统用户管理.sh
2019-10-29 18:22:19 +08:00

14 lines
474 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env bash
###################################################################################
# Linux 系统用户管理
# @author: Zhang Peng
###################################################################################
# 创建用户组
groupadd elk
# 创建新用户,-g elk 设置其用户组为 elk-p elk 设置其密码为 elk
useradd elk -g elk -p elk
# 更改 /opt 文件夹及内部文件的所属用户及组为 elk:elk
chown -R elk:elk /opt