在运行 Solaris 10 的服务器上,该命令useradd
无法添加新用户。运行useradd -m
会创建主目录,但所有目录的用户 ID 均为 50011。
请查看以下输出:
# useradd -s /bin/bash -m testuser
# echo $?
0
# passwd testuser
passwd: User unknown: testuser
Permission denied
# grep -i testuser /etc/passwd
# ls -lh /etc/passwd
-rw-r--r-- 1 root sys 779 Oct 6 2012 /etc/passwd
# ls -lh /etc/shadow
-r-------- 1 root sys 385 Nov 13 13:50 /etc/shadow
# type useradd
useradd is /usr/sbin/useradd
# useradd -s /bin/bash -d /home/testuser -m testuser
# passwd testuser
passwd: User unknown: testuser
Permission denied
# useradd testuser
# passwd testuser
passwd: User unknown: testuser
Permission denied
# ls -lth /home/ | head -6
total 36
drwxr-xr-x 2 50011 other 512 Nov 13 19:37 test3
drwxr-xr-x 2 50011 other 512 Nov 13 19:36 test2
drwxr-xr-x 2 50011 other 512 Nov 13 19:27 test1
drwxr-xr-x 2 50011 other 512 Nov 13 14:56 testuser
drwxr-xr-x 2 50011 other 512 Nov 13 14:46 test_user
# df -k /home;ls -l@ /usr/sbin/useradd; pkgchk SUNWcsu; grep passwd: /etc/nsswitch.conf
Filesystem kbytes used avail capacity Mounted on
/dev/dsk/c0t0d0s6 20646961 604690 19835802 3% /home
-r-xr-xr-x 2 root sys 40252 Jul 6 2011 /usr/sbin/useradd
passwd: files ldap
# useradd -s /bin/bash -b /export/home -m testuser
UX: useradd: ERROR: invalid syntax.
usage: useradd [-u uid [-o] | -g group | -G group[[,group]...] |-d dir |
-s shell | -c comment | -m [-k skel_dir] | -f inactive |
-e expire | -A authorization [, authorization ...] |
-P profile [, profile ...] | -R role [, role ...] |
-K key=value | -p project [, project ...]] login
useradd -D [-g group | -b base_dir | -f inactive | -e expire
-A authorization [, authorization ...] |
-P profile [, profile ...] | -R role [, role ...] |
-K key=value ... -p project]
# userdel testuser
UX: userdel: ERROR: testuser does not exist.
# truss -t\!memcntl,getuid,door_call,door_info,close,mmap,brk,munmap,lwp_sigmask,sigaction,llseek -f useradd -m -d /tmp/testuser testuser
1064: execve("/usr/sbin/useradd", 0xFFBFFCC4, 0xFFBFFCDC) argc = 5
1064: sysinfo(SI_MACHINE, "sun4v", 257) = 6
1064: resolvepath("/usr/lib/ld.so.1", "/lib/ld.so.1", 1023) = 12
1064: resolvepath("/usr/sbin/useradd", "/usr/sbin/useradd", 1023) = 17
1064: stat64("/usr/sbin/useradd", 0xFFBFF790) = 0
1064: open("/var/ld/ld.config", O_RDONLY) = 3
1064: fstat64(3, 0xFFBFF300) = 0
1064: stat64("/lib/libsecdb.so.1", 0xFFBFEEF0) = 0
1064: resolvepath("/lib/libsecdb.so.1", "/lib/libsecdb.so.1", 1023) = 18
1064: open("/lib/libsecdb.so.1", O_RDONLY) = 3
1064: stat64("/lib/libproject.so.1", 0xFFBFEEF0) Err#2 ENOENT
1064: stat64("/usr/lib/libproject.so.1", 0xFFBFEEF0) = 0
1064: resolvepath("/usr/lib/libproject.so.1", "/usr/lib/libproject.so.1", 1023) = 24
1064: open("/usr/lib/libproject.so.1", O_RDONLY) = 3
1064: stat64("/lib/libc.so.1", 0xFFBFEEF0) = 0
1064: resolvepath("/lib/libc.so.1", "/lib/libc.so.1", 1023) = 14
1064: open("/lib/libc.so.1", O_RDONLY) = 3
1064: stat64("/lib/libnsl.so.1", 0xFFBFEEF0) = 0
1064: resolvepath("/lib/libnsl.so.1", "/lib/libnsl.so.1", 1023) = 16
1064: open("/lib/libnsl.so.1", O_RDONLY) = 3
1064: stat64("/lib/libcmd.so.1", 0xFFBFEEF0) = 0
1064: resolvepath("/lib/libcmd.so.1", "/lib/libcmd.so.1", 1023) = 16
1064: open("/lib/libcmd.so.1", O_RDONLY) = 3
1064: stat64("/lib/libproc.so.1", 0xFFBFEEF0) = 0
1064: resolvepath("/lib/libproc.so.1", "/lib/libproc.so.1", 1023) = 17
1064: open("/lib/libproc.so.1", O_RDONLY) = 3
1064: stat64("/lib/librtld_db.so.1", 0xFFBFEEF0) = 0
1064: resolvepath("/lib/librtld_db.so.1", "/lib/librtld_db.so.1", 1023) = 20
1064: open("/lib/librtld_db.so.1", O_RDONLY) = 3
1064: stat64("/lib/libelf.so.1", 0xFFBFEEF0) = 0
1064: resolvepath("/lib/libelf.so.1", "/lib/libelf.so.1", 1023) = 16
1064: open("/lib/libelf.so.1", O_RDONLY) = 3
1064: stat64("/lib/libctf.so.1", 0xFFBFEEF0) = 0
1064: resolvepath("/lib/libctf.so.1", "/lib/libctf.so.1", 1023) = 16
1064: open("/lib/libctf.so.1", O_RDONLY) = 3
1064: getcontext(0xFFBFF600)
1064: getrlimit(RLIMIT_STACK, 0xFFBFF5E0) = 0
1064: getpid() = 1064 [1063]
1064: setustack(0xFF0B2A88)
1064: sigfillset(0xFF31B3BC) = 0
1064: stat64("/platform/SUNW,Sun-Fire-T200/lib/libc_psr.so.1", 0xFFBFEA90) = 0
1064: resolvepath("/platform/SUNW,Sun-Fire-T200/lib/libc_psr.so.1", "/platform/sun4v/lib/libc_psr.so.1", 1023) = 33
1064: open("/platform/SUNW,Sun-Fire-T200/lib/libc_psr.so.1", O_RDONLY) = 3
1064: sysconfig(_CONFIG_PAGESIZE) = 8192
1064: open("/usr/sadm/defadduser", O_RDONLY) = 3
1064: fstat64(3, 0xFFBFE768) = 0
1064: fstat64(3, 0xFFBFE610) = 0
1064: ioctl(3, TCGETA, 0xFFBFE6F4) Err#25 ENOTTY
1064: read(3, " #\t D e f a u l t v a".., 8192) = 286
1064: read(3, 0x0002B23C, 8192) = 0
1064: getpid() = 1064 [1063]
1064: open("/proc/1064/psinfo", O_RDONLY) = 3
1064: read(3, "02\0\0\0\0\0\001\0\004 (".., 336) = 336
1064: open64("/var/run/name_service_door", O_RDONLY) = 3
1064: fcntl(3, F_SETFD, 0x00000001) = 0
1064: stat("/tmp/testuser", 0xFFBFEBB8) = 0
1064: schedctl() = 0xFF330000
1064: fork1() = 1065
1065: fork1() (returning as child ...) = 1064
1065: getpid() = 1065 [1064]
1065: lwp_self() = 1
1065: open("/dev/null", O_RDWR|O_CREAT|O_TRUNC, 0666) = 1
1065: open("/dev/null", O_RDWR|O_CREAT|O_TRUNC, 0666) = 2
1065: execve("/usr/bin/passmgmt", 0x0002B670, 0x0002C0F4) argc = 29
1065: sysinfo(SI_MACHINE, "sun4v", 257) = 6
1065: resolvepath("/usr/sbin/passmgmt", "/usr/sbin/passmgmt", 1023) = 18
1065: stat64("/usr/sbin/passmgmt", 0xFFBFF680) = 0
1065: open("/var/ld/ld.config", O_RDONLY) = 3
1065: fstat64(3, 0xFFBFF1F0) = 0
1065: stat64("/lib/libsecdb.so.1", 0xFFBFEDE0) = 0
1065: resolvepath("/lib/libsecdb.so.1", "/lib/libsecdb.so.1", 1023) = 18
1065: open("/lib/libsecdb.so.1", O_RDONLY) = 3
1065: stat64("/lib/passwdutil.so.1", 0xFFBFEDE0) Err#2 ENOENT
1065: stat64("/usr/lib/passwdutil.so.1", 0xFFBFEDE0) = 0
1065: resolvepath("/usr/lib/passwdutil.so.1", "/usr/lib/passwdutil.so.1", 1023) = 24
1065: open("/usr/lib/passwdutil.so.1", O_RDONLY) = 3
1065: stat64("/lib/libc.so.1", 0xFFBFEDE0) = 0
1065: resolvepath("/lib/libc.so.1", "/lib/libc.so.1", 1023) = 14
1065: open("/lib/libc.so.1", O_RDONLY) = 3
1065: stat64("/lib/libnsl.so.1", 0xFFBFEDE0) = 0
1065: resolvepath("/lib/libnsl.so.1", "/lib/libnsl.so.1", 1023) = 16
1065: open("/lib/libnsl.so.1", O_RDONLY) = 3
1065: stat64("/lib/libcmd.so.1", 0xFFBFEDE0) = 0
1065: resolvepath("/lib/libcmd.so.1", "/lib/libcmd.so.1", 1023) = 16
1065: open("/lib/libcmd.so.1", O_RDONLY) = 3
1065: getcontext(0xFFBFF4F0)
1065: getrlimit(RLIMIT_STACK, 0xFFBFF4D0) = 0
1065: getpid() = 1065 [1064]
1065: setustack(0xFF362A88)
1065: sigfillset(0xFF31B3BC) = 0
1065: stat64("/platform/SUNW,Sun-Fire-T200/lib/libc_psr.so.1", 0xFFBFE980) = 0
1065: resolvepath("/platform/SUNW,Sun-Fire-T200/lib/libc_psr.so.1", "/platform/sun4v/lib/libc_psr.so.1", 1023) = 33
1065: open("/platform/SUNW,Sun-Fire-T200/lib/libc_psr.so.1", O_RDONLY) = 3
1065: time() = 1384439953
1065: open("/var/run/tzsync", O_RDONLY) = 3
1065: open("/usr/share/lib/zoneinfo/US/Eastern", O_RDONLY) = 3
1065: fstat64(3, 0xFFBFF4A0) = 0
1065: read(3, " T Z i f\0\0\0\0\0\0\0\0".., 1267) = 1267
1065: creat("/etc/.pwd.lock", 0600) = 3
1065: fcntl(3, F_SETLK, 0xFF3159D0) = 0
1065: getpid() = 1065 [1064]
1065: stat64("/lib/libsldap.so.1", 0xFFBFE980) Err#2 ENOENT
1065: stat64("/usr/lib/libsldap.so.1", 0xFFBFE980) = 0
1065: resolvepath("/usr/lib/libsldap.so.1", "/usr/lib/libsldap.so.1", 1023) = 22
1065: open("/usr/lib/libsldap.so.1", O_RDONLY) = 4
1065: stat64("/lib/libldap.so.5", 0xFFBFE8A0) Err#2 ENOENT
1065: stat64("/usr/lib/libldap.so.5", 0xFFBFE8A0) = 0
1065: resolvepath("/usr/lib/libldap.so.5", "/usr/lib/libldap.so.5", 1023) = 21
1065: open("/usr/lib/libldap.so.5", O_RDONLY) = 4
1065: stat64("/lib/libscf.so.1", 0xFFBFE8A0) = 0
1065: resolvepath("/lib/libscf.so.1", "/lib/libscf.so.1", 1023) = 16
1065: open("/lib/libscf.so.1", O_RDONLY) = 4
1065: stat64("/lib/libdoor.so.1", 0xFFBFE8A0) = 0
1065: resolvepath("/lib/libdoor.so.1", "/lib/libdoor.so.1", 1023) = 17
1065: open("/lib/libdoor.so.1", O_RDONLY) = 4
1065: stat64("/usr/lib/mps/libc.so.1", 0xFFBFE8A0) Err#2 ENOENT
1065: stat64("/lib/libuutil.so.1", 0xFFBFE8A0) = 0
1065: resolvepath("/lib/libuutil.so.1", "/lib/libuutil.so.1", 1023) = 18
1065: open("/lib/libuutil.so.1", O_RDONLY) = 4
1065: stat64("/lib/libgen.so.1", 0xFFBFE8A0) = 0
1065: resolvepath("/lib/libgen.so.1", "/lib/libgen.so.1", 1023) = 16
1065: open("/lib/libgen.so.1", O_RDONLY) = 4
1065: stat64("/usr/lib/mps/libsocket.so.1", 0xFFBFE598) Err#2 ENOENT
1065: stat64("/lib/libsocket.so.1", 0xFFBFE598) = 0
1065: resolvepath("/lib/libsocket.so.1", "/lib/libsocket.so.1", 1023) = 19
1065: open("/lib/libsocket.so.1", O_RDONLY) = 4
1065: stat64("/usr/lib/mps/libnsl.so.1", 0xFFBFE598) Err#2 ENOENT
1065: stat64("/lib/libmp.so.2", 0xFFBFE980) = 0
1065: resolvepath("/lib/libmp.so.2", "/lib/libmp.so.2", 1023) = 15
1065: open("/lib/libmp.so.2", O_RDONLY) = 4
1065: stat64("/lib/libmd.so.1", 0xFFBFE980) = 0
1065: resolvepath("/lib/libmd.so.1", "/lib/libmd.so.1", 1023) = 15
1065: open("/lib/libmd.so.1", O_RDONLY) = 4
1065: stat64("/usr/lib/mps/libsasl.so.1", 0xFFBFE980) Err#2 ENOENT
1065: stat64("/lib/libsasl.so.1", 0xFFBFE980) Err#2 ENOENT
1065: stat64("/usr/lib/libsasl.so.1", 0xFFBFE980) = 0
1065: resolvepath("/usr/lib/libsasl.so.1", "/usr/lib/libsasl.so.1", 1023) = 21
1065: open("/usr/lib/libsasl.so.1", O_RDONLY) = 4
1065: stat64("/platform/SUNW,Sun-Fire-T200/lib/libmd_psr.so.1", 0xFFBFE4C8) = 0
1065: resolvepath("/platform/SUNW,Sun-Fire-T200/lib/libmd_psr.so.1", "/platform/sun4v/lib/libmd_psr.so.1", 1023) = 34
1065: open("/platform/SUNW,Sun-Fire-T200/lib/libmd_psr.so.1", O_RDONLY) = 4
1065: stat64("/usr/lib/mps/libmd.so.1", 0xFFBFE980) Err#2 ENOENT
1065: stat64("/usr/lib/mps/libnspr4.so", 0xFFBFE980) = 0
1065: resolvepath("/usr/lib/mps/libnspr4.so", "/usr/lib/mps/libnspr4.so", 1023) = 24
1065: open("/usr/lib/mps/libnspr4.so", O_RDONLY) = 4
1065: stat64("/lib/libpthread.so.1", 0xFFBFE8A0) = 0
1065: resolvepath("/lib/libpthread.so.1", "/lib/libpthread.so.1", 1023) = 20
1065: open("/lib/libpthread.so.1", O_RDONLY) = 4
1065: stat64("/lib/librt.so.1", 0xFFBFE8A0) = 0
1065: resolvepath("/lib/librt.so.1", "/lib/librt.so.1", 1023) = 15
1065: open("/lib/librt.so.1", O_RDONLY) = 4
1065: stat64("/lib/libdl.so.1", 0xFFBFE8A0) = 0
1065: resolvepath("/lib/libdl.so.1", "/lib/libdl.so.1", 1023) = 15
1065: open("/lib/libdl.so.1", O_RDONLY) = 4
1065: stat64("/lib/libaio.so.1", 0xFFBFE8A0) = 0
1065: resolvepath("/lib/libaio.so.1", "/lib/libaio.so.1", 1023) = 16
1065: open("/lib/libaio.so.1", O_RDONLY) = 4
1065: sysinfo(SI_ISALIST, "sparcv9 sparcv8plus sparcv8 sparcv8-fsmuld sparcv7 sparc sparcv9+vis sparcv9+vis2 sparcv8plus+vis sparcv8plus+vis2", 257) = 115
1065: stat64("/usr/lib/mps/cpu/sparcv9/libnspr_flt4.so", 0xFFBFE4C8) Err#2 ENOENT
1065: stat64("/usr/lib/mps/cpu/sparcv8plus/libnspr_flt4.so", 0xFFBFE4C8) = 0
1065: resolvepath("/usr/lib/mps/cpu/sparcv8plus/libnspr_flt4.so", "/usr/lib/mps/cpu/sparcv8plus/libnspr_flt4.so", 1023) = 44
1065: open("/usr/lib/mps/cpu/sparcv8plus/libnspr_flt4.so", O_RDONLY) = 4
1065: stat64("/usr/lib/mps/libplc4.so", 0xFFBFE980) = 0
1065: resolvepath("/usr/lib/mps/libplc4.so", "/usr/lib/mps/libplc4.so", 1023) = 23
1065: open("/usr/lib/mps/libplc4.so", O_RDONLY) = 4
1065: stat64("/usr/lib/mps/libnss3.so", 0xFFBFE980) = 0
1065: resolvepath("/usr/lib/mps/libnss3.so", "/usr/lib/mps/libnss3.so", 1023) = 23
1065: open("/usr/lib/mps/libnss3.so", O_RDONLY) = 4
1065: stat64("/usr/lib/mps/libnssutil3.so", 0xFFBFE8A0) = 0
1065: resolvepath("/usr/lib/mps/libnssutil3.so", "/usr/lib/mps/libnssutil3.so", 1023) = 27
1065: open("/usr/lib/mps/libnssutil3.so", O_RDONLY) = 4
1065: stat64("/usr/lib/mps/libplds4.so", 0xFFBFE8A0) = 0
1065: resolvepath("/usr/lib/mps/libplds4.so", "/usr/lib/mps/libplds4.so", 1023) = 24
1065: open("/usr/lib/mps/libplds4.so", O_RDONLY) = 4
1065: stat64("/usr/lib/mps/secv1/libc.so.1", 0xFFBFE8A0) Err#2 ENOENT
1065: stat64("/usr/lib/mps/libssl3.so", 0xFFBFE980) = 0
1065: resolvepath("/usr/lib/mps/libssl3.so", "/usr/lib/mps/libssl3.so", 1023) = 23
1065: open("/usr/lib/mps/libssl3.so", O_RDONLY) = 4
1065: stat64("/usr/lib/mps/libthread.so.1", 0xFFBFE8A0) Err#2 ENOENT
1065: stat64("/usr/lib/mps/secv1/libthread.so.1", 0xFFBFE8A0) Err#2 ENOENT
1065: stat64("/lib/libthread.so.1", 0xFFBFE8A0) = 0
1065: resolvepath("/lib/libthread.so.1", "/lib/libthread.so.1", 1023) = 19
1065: open("/lib/libthread.so.1", O_RDONLY) = 4
1065: stat64("/usr/lib/mps/librt.so.1", 0xFFBFE8A0) Err#2 ENOENT
1065: stat64("/usr/lib/mps/secv1/librt.so.1", 0xFFBFE8A0) Err#2 ENOENT
1065: write(2, " l d . s o . 1 : p a s".., 130) = 130
1065: write(2, "\n", 1) = 1
1065: lwp_self() = 1
1064: waitid(P_ALL, 0, 0xFFBFE980, WEXITED|WTRAPPED) = 0
1064: _exit(0)
# ldd /usr/sbin/passmgmt /usr/lib/passwdutil.so.1
/usr/sbin/passmgmt:
libsecdb.so.1 => /lib/libsecdb.so.1
passwdutil.so.1 => /usr/lib/passwdutil.so.1
libc.so.1 => /lib/libc.so.1
libnsl.so.1 => /lib/libnsl.so.1
libcmd.so.1 => /lib/libcmd.so.1
libsldap.so.1 => /usr/lib/libsldap.so.1
libmp.so.2 => /lib/libmp.so.2
libmd.so.1 => /lib/libmd.so.1
libscf.so.1 => /lib/libscf.so.1
libldap.so.5 => /usr/lib/libldap.so.5
libdoor.so.1 => /lib/libdoor.so.1
libuutil.so.1 => /lib/libuutil.so.1
libgen.so.1 => /lib/libgen.so.1
libsasl.so.1 => /usr/lib/libsasl.so.1
libsocket.so.1 => /lib/libsocket.so.1
libnspr4.so => /usr/lib/mps/libnspr4.so
libplc4.so => /usr/lib/mps/libplc4.so
libnss3.so => /usr/lib/mps/libnss3.so
libssl3.so => /usr/lib/mps/libssl3.so
libpthread.so.1 => /lib/libpthread.so.1
librt.so.1 => /lib/librt.so.1
libdl.so.1 => /lib/libdl.so.1
libnssutil3.so => /usr/lib/mps/libnssutil3.so
libplds4.so => /usr/lib/mps/libplds4.so
libthread.so.1 => /lib/libthread.so.1
libaio.so.1 => /lib/libaio.so.1
libm.so.2 => /lib/libm.so.2
/platform/SUNW,Sun-Fire-T200/lib/libc_psr.so.1
/platform/SUNW,Sun-Fire-T200/lib/libmd_psr.so.1
/usr/lib/mps/cpu/sparcv8plus/libnspr_flt4.so
/usr/lib/passwdutil.so.1:
libcmd.so.1 => /lib/libcmd.so.1
libsldap.so.1 => /usr/lib/libsldap.so.1
libnsl.so.1 => /lib/libnsl.so.1
libc.so.1 => /lib/libc.so.1
libldap.so.5 => /usr/lib/libldap.so.5
libscf.so.1 => /lib/libscf.so.1
libdoor.so.1 => /lib/libdoor.so.1
libmp.so.2 => /lib/libmp.so.2
libmd.so.1 => /lib/libmd.so.1
libsasl.so.1 => /usr/lib/libsasl.so.1
libsocket.so.1 => /lib/libsocket.so.1
libnspr4.so => /usr/lib/mps/libnspr4.so
libplc4.so => /usr/lib/mps/libplc4.so
libnss3.so => /usr/lib/mps/libnss3.so
libssl3.so => /usr/lib/mps/libssl3.so
libuutil.so.1 => /lib/libuutil.so.1
libgen.so.1 => /lib/libgen.so.1
libpthread.so.1 => /lib/libpthread.so.1
librt.so.1 => /lib/librt.so.1
libdl.so.1 => /lib/libdl.so.1
libnssutil3.so => /usr/lib/mps/libnssutil3.so
libplds4.so => /usr/lib/mps/libplds4.so
libthread.so.1 => /lib/libthread.so.1
libaio.so.1 => /lib/libaio.so.1
libm.so.2 => /lib/libm.so.2
/platform/SUNW,Sun-Fire-T200/lib/libc_psr.so.1
/platform/SUNW,Sun-Fire-T200/lib/libmd_psr.so.1
/usr/lib/mps/cpu/sparcv8plus/libnspr_flt4.so
# pkgchk SUNWtls1
WARNING: no pathnames were associated with <SUNWtls1>
# set|grep LD;crle;truss -w2 -ft open useradd -s /bin/bash -d /home/testuser -m testuser
Configuration file [version 4]: /var/ld/ld.config
Platform: 32-bit MSB SPARC
Default Library Path (ELF): /lib:/usr/lib:/usr/sfw/lib
Trusted Directories (ELF): /lib/secure:/usr/lib/secure (system default)
Command line:
crle -c /var/ld/ld.config -l /lib:/usr/lib:/usr/sfw/lib
922: open("/var/ld/ld.config", O_RDONLY) = 3
922: open("/lib/libsecdb.so.1", O_RDONLY) = 3
922: open("/usr/lib/libproject.so.1", O_RDONLY) = 3
922: open("/lib/libc.so.1", O_RDONLY) = 3
922: open("/lib/libnsl.so.1", O_RDONLY) = 3
922: open("/lib/libcmd.so.1", O_RDONLY) = 3
922: open("/lib/libproc.so.1", O_RDONLY) = 3
922: open("/lib/librtld_db.so.1", O_RDONLY) = 3
922: open("/lib/libelf.so.1", O_RDONLY) = 3
922: open("/lib/libctf.so.1", O_RDONLY) = 3
922: open("/platform/SUNW,Sun-Fire-T200/lib/libc_psr.so.1", O_RDONLY) = 3
922: open("/usr/sadm/defadduser", O_RDONLY) = 3
922: open("/proc/922/psinfo", O_RDONLY) = 3
922: open64("/var/run/name_service_door", O_RDONLY) = 3
923: open("/dev/null", O_RDWR|O_CREAT|O_TRUNC, 0666) = 1
923: open("/dev/null", O_RDWR|O_CREAT|O_TRUNC, 0666) = 2
923: open("/var/ld/ld.config", O_RDONLY) = 3
923: open("/lib/libsecdb.so.1", O_RDONLY) = 3
923: open("/usr/lib/passwdutil.so.1", O_RDONLY) = 3
923: open("/lib/libc.so.1", O_RDONLY) = 3
923: open("/lib/libnsl.so.1", O_RDONLY) = 3
923: open("/lib/libcmd.so.1", O_RDONLY) = 3
923: open("/platform/SUNW,Sun-Fire-T200/lib/libc_psr.so.1", O_RDONLY) = 3
923: open("/var/run/tzsync", O_RDONLY) = 3
923: open("/usr/share/lib/zoneinfo/US/Eastern", O_RDONLY) = 3
923: open("/usr/lib/libsldap.so.1", O_RDONLY) = 4
923: open("/usr/lib/libldap.so.5", O_RDONLY) = 4
923: open("/lib/libscf.so.1", O_RDONLY) = 4
923: open("/lib/libdoor.so.1", O_RDONLY) = 4
923: open("/lib/libuutil.so.1", O_RDONLY) = 4
923: open("/lib/libgen.so.1", O_RDONLY) = 4
923: open("/lib/libsocket.so.1", O_RDONLY) = 4
923: open("/lib/libmp.so.2", O_RDONLY) = 4
923: open("/lib/libmd.so.1", O_RDONLY) = 4
923: open("/usr/lib/libsasl.so.1", O_RDONLY) = 4
923: open("/platform/SUNW,Sun-Fire-T200/lib/libmd_psr.so.1", O_RDONLY) = 4
923: open("/usr/lib/mps/libnspr4.so", O_RDONLY) = 4
923: open("/lib/libpthread.so.1", O_RDONLY) = 4
923: open("/lib/librt.so.1", O_RDONLY) = 4
923: open("/lib/libdl.so.1", O_RDONLY) = 4
923: open("/lib/libaio.so.1", O_RDONLY) = 4
923: open("/usr/lib/mps/cpu/sparcv8plus/libnspr_flt4.so", O_RDONLY) = 4
923: open("/usr/lib/mps/libplc4.so", O_RDONLY) = 4
923: open("/usr/lib/mps/libnss3.so", O_RDONLY) = 4
923: open("/usr/lib/mps/libnssutil3.so", O_RDONLY) = 4
923: open("/usr/lib/mps/libplds4.so", O_RDONLY) = 4
923: open("/usr/lib/mps/libssl3.so", O_RDONLY) = 4
923: open("/lib/libthread.so.1", O_RDONLY) = 4
923: write(2, 0xFF3FC74C, 130) = 130
923: l d . s o . 1 : p a s s m g m t : f a t a l : r e l o c a
923: t i o n e r r o r : f i l e / u s r / s b i n / p a s s m
923: g m t : s y m b o l _ _ p w u _ l o c k i n g _ r e s t r i
923: c t i v e : r e f e r e n c e d s y m b o l n o t f o u
923: n d
923: write(2, "\n", 1) = 1
925: open("/var/ld/ld.config", O_RDONLY) = 3
925: open("/lib/libc.so.1", O_RDONLY) = 3
925: open("/platform/SUNW,Sun-Fire-T200/lib/libc_psr.so.1", O_RDONLY) = 3
925: open("/lib/libsec.so.1", O_RDONLY) = 3
925: open("/lib/libavl.so.1", O_RDONLY) = 3
925: open("/lib/libcmdutils.so.1", O_RDONLY) = 3
925: open64("/etc/skel/.profile", O_RDONLY) = 4
925: open64("/etc/skel/local.cshrc", O_RDONLY) = 4
925: open64("/etc/skel/local.login", O_RDONLY) = 4
925: open64("/etc/skel/local.profile", O_RDONLY) = 4
927: open("/var/ld/ld.config", O_RDONLY) = 3
927: open("/lib/libcmdutils.so.1", O_RDONLY) = 3
927: open("/lib/libc.so.1", O_RDONLY) = 3
927: open("/lib/libavl.so.1", O_RDONLY) = 3
927: open("/platform/SUNW,Sun-Fire-T200/lib/libc_psr.so.1", O_RDONLY) = 3
#
# passmgmt
ld.so.1: passmgmt: fatal: relocation error: file /usr/sbin/passmgmt: symbol __pwu_locking_restrictive: referenced symbol not found
Killed
#
# pkgchk SUNWcsl SUNWcslr SUNWdpl SUNWlibms SUNWlibmsr SUNWlibsasl SUNWpr SUNWtls
WARNING: no pathnames were associated with <SUNWdpl>
# ldd -dp /usr/bin/passmgmt
libsecdb.so.1 => /lib/libsecdb.so.1
passwdutil.so.1 => /usr/lib/passwdutil.so.1
libc.so.1 => /lib/libc.so.1
libnsl.so.1 => /lib/libnsl.so.1
libcmd.so.1 => /lib/libcmd.so.1
libsldap.so.1 => /usr/lib/libsldap.so.1
libmp.so.2 => /lib/libmp.so.2
libmd.so.1 => /lib/libmd.so.1
libscf.so.1 => /lib/libscf.so.1
libldap.so.5 => /usr/lib/libldap.so.5
libdoor.so.1 => /lib/libdoor.so.1
libuutil.so.1 => /lib/libuutil.so.1
libgen.so.1 => /lib/libgen.so.1
libsasl.so.1 => /usr/lib/libsasl.so.1
libsocket.so.1 => /lib/libsocket.so.1
libnspr4.so => /usr/lib/mps/libnspr4.so
libplc4.so => /usr/lib/mps/libplc4.so
libnss3.so => /usr/lib/mps/libnss3.so
libssl3.so => /usr/lib/mps/libssl3.so
libpthread.so.1 => /lib/libpthread.so.1
librt.so.1 => /lib/librt.so.1
libdl.so.1 => /lib/libdl.so.1
libnssutil3.so => /usr/lib/mps/libnssutil3.so
libplds4.so => /usr/lib/mps/libplds4.so
libthread.so.1 => /lib/libthread.so.1
libaio.so.1 => /lib/libaio.so.1
libm.so.2 => /lib/libm.so.2
/platform/SUNW,Sun-Fire-T200/lib/libc_psr.so.1
/platform/SUNW,Sun-Fire-T200/lib/libmd_psr.so.1
/usr/lib/mps/cpu/sparcv8plus/libnspr_flt4.so
后续:几周后,我们最终重新安装了操作系统来解决该问题。
答案1
您似乎观察到的绝对不是预期的行为。
我怀疑你useradd
是真正的包装器,丢弃了 stderr 和命令状态。
可以使用以下命令检查这一点:
type useradd
useradd 在 Solaris 上失败的一个常见原因是家庭自动挂载程序无法使用该-m
选项。
这应该有效:
useradd -s /bin/bash -d /export/home/testuser -m testuser
PS:使用#
root 提示符是一个既定的约定。不遵循它,尤其是在发帖时,绝对会令人困惑。
更新:
有几件事需要检查:
1:看来您的 ldap 配置已损坏,由于某种原因,加载器不再在标准目录中查找来加载 libthread 和 librt 等库。尝试至少暂时禁用 ldap,方法是ldap
从以下密码条目中删除 out /etc/nsswitch.conf
:
passwd: files
然后再次尝试创建您的用户。
3:如果useradd
仍然失败,请将您的 pam 配置文件 ( /etc/pam.conf
) 与其他服务器的配置文件进行比较是否有任何差异。
4:如果也失败了,我猜你安装了一些与库不兼容的东西和/或只是错过了 Solaris 补丁。