当前位置: 技术问答>linux和unix
求解释: useradd -g mysql mysql -d /home/mysql -s /sbin/nologin
来源: 互联网 发布时间:2016-12-01
本文导语: 每个参数都是什么意思?整个命令起到的作用...谢谢! | 其实这个命令的 主要偏重点是让mysql服务用的mysql用户不可以登录系统。 | man useradd -g, --gid gid ...
每个参数都是什么意思?整个命令起到的作用...谢谢!
|
其实这个命令的 主要偏重点是让mysql服务用的mysql用户不可以登录系统。
|
man useradd
-g, --gid gid
The group name or number of the user's main group. The group name or number must refer to an already existing group. If not specified, the default
from /etc/default/useradd is used.
-d, --home homedir
This option specifies the users home directory. If not specified, the default from /etc/default/useradd is used.
-s, --shell shell
Specify user's login shell. The default for normal user accounts is taken from /etc/default/useradd/, the default for system accounts is /bin/false.
-g, --gid gid
The group name or number of the user's main group. The group name or number must refer to an already existing group. If not specified, the default
from /etc/default/useradd is used.
-d, --home homedir
This option specifies the users home directory. If not specified, the default from /etc/default/useradd is used.
-s, --shell shell
Specify user's login shell. The default for normal user accounts is taken from /etc/default/useradd/, the default for system accounts is /bin/false.
|
useradd -g mysql mysql -d /home/mysql -s /sbin/nologin
man useradd
大概就是增加mysql这个用户,同时添加到mysql组理,主目录是/home/mysql 不给登录shell
man useradd
大概就是增加mysql这个用户,同时添加到mysql组理,主目录是/home/mysql 不给登录shell