如果操作系统限制了sudo useradd,还可以用ISVD 10的idsadduser命令来完成添加用户的操作。
命令解析:-u 用户名 -g 宿组名 -l home路径
$ sudo /opt/ibm/ldap/V10.0.2/sbin/idsadduser -u db2fenc1 -g db2iadm1 -l /data/db2fenc1
GLPWRP123I The program ‘/opt/ibm/ldap/V10.0.2/sbin/64/idsadduser’ is used with the following arguments ‘-u db2fenc1 -g db2iadm1 -l /data/db2fenc1’.
You have chosen to perform the following actions:
GLPGRP019I System user will be created for directory server instance.
GLPGRP020I The system user ‘db2fencl’ will be created.
GLPGRP021I The user’s primary group ‘db2iadm1’ will be created.
GLPGRP022I The home directory for user ‘db2fencl’ will be ‘/data/db2fencl’.
GLPGRP024I The user ‘db2fencl’ will be a member of group ‘idsldap’.
GLPGRP025I The user ‘root’ will be a member of group ‘db2iadm1’.
GLPGRP005I The password for user ‘db2fencl’ will be set.
Do you want to….
(1) Continue with the above actions, or
(2) Exit without making any changes:1
GLPGRP034I The group ‘db2iadm1’ already exists.
GLPGRP029I The user ‘db2fenc1’ was created successfully.
GLPGRP030I The user ‘db2fenc1’ was added to group ‘db2iadm1’ successfully.
GLPGRP031I Added user ‘root’ to group ‘db2iadm1’ successfully.
GLPGRP006I Setting the password for user ‘db2fenc1’
GLPGRP007I Successfully changed password for user ‘db2fenc1’.