普通用戶登陸ssh後使用 su 切換到root用戶,發現使用groupadd useradd等命令時提示沒有這個命令,很是疑惑,如下:
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel) context=user_u:system_r:unconfined_t
[root@node1 lian]# whoami
root
[root@node1 lian]# groupad
bash: groupad: command not found
[root@node1 lian]# useradd
bash: useradd: command not found
[root@node1 lian]# su -
[root@node1 ~]# groupadd oinstall
[root@node1 ~]# groupadd
Usage: groupadd [options] group
Options:
-f, --force force exit with success status if the specified
group already exists
-r, create system account
-g, --gid GID use GID for the new group
-h, --help display this help message and exit
-K, --key KEY=VALUE overrides /etc/login.defs defaults
-o, --non-unique allow create group with duplicate
(non-unique) GID
[root@node1 ~]#
通過上網查了一下,原來需要su - 切換到root纔行,暈