mirror of
https://github.com/dunwu/linux-tutorial.git
synced 2024-04-15 19:55:24 +08:00
14 lines
474 B
Bash
14 lines
474 B
Bash
#!/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
|