Root user not recognizing on Solaris-10 (shadow file corruption)

Hello,
I got into a wired state on one of solaris 10 server. When I noticed that server is having some issue, I found that there were dumpadm.conf entries in /etc/shadow and real entries were wiped of. Probably somebody fat fingers.
I was able to boot into failsafe, break SVM mirror, copied /etc/oshadow to /etc/shadow and boot into single user mode. But there is still some issue and I am not sure how to fix it. OS is not able to recognize root, looks like its mapping with UID is broken. shadow file is owned by "1 0". If I touch a new file, that also created with same ownership.
I boot into failsafe mode and there it already shows ownership of root (/a/etc/shadow). Then I did "chown 0:sys /a/etc/shadow" and boot again in single user mode. Still no luck.

# ls -l /etc/passwd /etc/shadow
-rw-r--r--   1 0        sys         1846 Oct 22 15:07 /etc/passwd
-r--------   1 0        sys         1818 Oct 22 15:08 /etc/shadow
# id
uid=0 gid=0(root)
# id -a
uid=0 gid=0(root)
# id -a root
id: invalid user name: "root"
# cat /etc/shadow | grep -i root
root:x:18191::::::
# cat /etc/passwd | grep -i root
root:x:0:0:Super-User:/:/sbin/sh
# chown root:sys /etc/shadow
chown: unknown user id root
#

Please suggest, how can I fix it. Boot from Solaris DVD is last option as, this server is located remotely.

Thanks

You don't have backups of your remote server?

No backup for this server.
Though I have /etc/oshadow files and even I have similar /etc/shadow from other servers, but copying them is not helpful

Please provide this info:

cat /etc/passwd

and

cat /etc/shadow

EDIT: Never mind... I see you already did this for the root entries.

# cat /etc/passwd
root:x:0:0:Super-User:/:/sbin/sh
daemon:x:1:1::/:
bin:x:2:2::/usr/bin:
sys:x:3:3::/:
adm:x:4:4:Admin:/var/adm:
lp:x:71:8:Line Printer Admin:/usr/spool/lp:
uucp:x:5:5:uucp Admin:/usr/lib/uucp:
nuucp:x:9:9:uucp Admin:/var/spool/uucppublic:/usr/lib/uucp/uucico
smmsp:x:25:25:SendMail Message Submission Program:/:
listen:x:37:4:Network Admin:/usr/net/nls:
gdm:x:50:50:GDM Reserved UID:/:
webservd:x:80:80:WebServer Reserved UID:/:
postgres:x:90:90:PostgreSQL Reserved UID:/:/usr/bin/pfksh
svctag:x:95:12:Service Tag UID:/:
nobody:x:60001:60001:NFS Anonymous Access User:/:
noaccess:x:60002:60002:No Access User:/:
nobody4:x:65534:65534:SunOS 4.x NFS Anonymous Access User:/:
prodadm:x:16667:16667:Production Admin:/export/home/prodadm:/bin/csh
oeuser:x:16666:16666:Operations User:/export/home/oeuser:/bin/ksh
prodse:x:50000:50000:SE internal user:/export/home/prodse:/bin/ksh
osiris:x:50031:50031:Osiris Scan Agent:/export/apps/osiris/client:/bin/sh
tdradm:x:16701:16701:TDR Admin User:/export/home/tdradm:/bin/csh
espadm:x:16702:16702:ESP Admin User:/export/home/espadm:/bin/csh
pdeadm:x:16703:16703:PDE Admin User:/export/home/pdeadm:/bin/csh
nenaadm:x:16704:16704:NENA Admin User:/export/home/nenaadm:/bin/csh
pamadm:x:16705:16705:PAM Admin User:/export/home/pamadm:/bin/csh
routadm:x:16706:16706:Call Routing Admin user:/export/home/routadm:/bin/csh
timesten:x:40004:40002:TimesTen User:/export/timesten:/bin/ksh
aliadm:x:16708:16708:ALI Admin User:/export/home/aliadm:/bin/csh
xyexport:x:1062:107:Export user:/export/home/xyexport:/bin/ksh
opc_op:x:777:177:OVO default operator:/export/home/opc_op:/usr/xpg4/bin/sh
esxkadm:x:16711:16711::/export/home/esxkadm:/bin/tcsh
mpcadm:x:16709:16709::/export/home/mpcadm:/bin/tcsh
alinkadm:x:16712:16712::/export/home/alinkadm:/bin/tcsh
+@IDS:x:::::
+@WTA:x:::::
+@NSS:x:::::
+@TIER2:x:::::
+@NE:x:::::
#
# cat /etc/shadow
root:x:18191::::::
daemon:x:18191::::::
bin:x:18191::::::
sys:x:18191::::::
adm:x:18191::::::
lp:x:18191::::::
uucp:x:18191::::::
nuucp:x:18191::::::
smmsp:x:18191::::::
listen:x:18191::::::
gdm:x:18191::::::
webservd:x:18191::::::
postgres:x:18191::::::
svctag:x:18191::::::
nobody:x:18191::::::
noaccess:x:18191::::::
nobody4:x:18191::::::
prodadm:x:18191::::::
oeuser:x:18191::::::
prodse:x:18191::::::
osiris:x:18191::::::
tdradm:x:18191::::::
espadm:x:18191::::::
pdeadm:x:18191::::::
nenaadm:x:18191::::::
pamadm:x:18191::::::
routadm:x:18191::::::
timesten:x:18191::::::
aliadm:x:18191::::::
xyexport:x:18191::::::
opc_op:x:18191::::::
esxkadm:x:18191::::::
mpcadm:x:18191::::::
alinkadm:x:18191::::::
+@IDS:x:18191::::::
+@WTA:x:18191::::::
+@NSS:x:18191::::::
+@TIER2:x:18191::::::
+@NE:x:18191::::::
#

I see whatever was owned by root, is owned by "1 0"

# ls -l /etc/
total 606
-rw-r--r--   1 0        root         773 Jan 16  2015 1
drwxr-xr-x   2 4        adm          512 Sep 16  2010 acct
-rw-r--r--   1 0        sys          253 Aug 25  2008 aggregation.conf
lrwxrwxrwx   1 0        root          14 Sep 16  2010 aliases -> ./mail/aliases
-rw-r--r--   1 0        bin          194 Jan 21  2005 auto_home
-rw-r--r--   1 0        bin          248 Jan 21  2005 auto_master
lrwxrwxrwx   1 0        root          16 Sep 16  2010 autopush -> ../sbin/autopush
-rw-r--r--   1 0        root           0 Dec 10  2010 bootparams
drwxr-xr-x   3 0        sys          512 Sep 16  2010 cacao
drwxr-xr-x   2 0        sys          512 Sep 16  2010 certs
lrwxrwxrwx   1 0        root          18 Sep 16  2010 cfgadm -> ../usr/sbin/cfgadm
lrwxrwxrwx   1 0        root          18 Sep 16  2010 chroot -> ../usr/sbin/chroot
lrwxrwxrwx   1 0        root          16 Sep 16  2010 clri -> ../usr/sbin/clri
-rw-r--r--   1 0        other        372 Oct 21 12:54 coreadm.conf
lrwxrwxrwx   1 0        root          16 Sep 16  2010 cron -> ../usr/sbin/cron

How about

cat /etc/oshadow

?

It is same, because when I found that /etc/shadow is not good, I copied contents of /etc/oshadow to /etc/shadow

# diff /etc/oshadow /etc/shadow
#

AH....

What happens when you try to add a new user?

Can you successfully add a new user?

# groupadd -g 1002 johnsp
# useradd -m -d /export/home/johnsp -u 1002 -g 1002 -s /bin/bash johnsp
64 blocks
# id -a johnsp
id: invalid user name: "johnsp"
# cat /etc/passwd | grep johnsp
johnsp:x:1002:1002::/export/home/johnsp:/bin/bash
# cat /etc/shadow | grep johnsp
johnsp:*LK*:::::::
# passwd -d johnsp
passwd: password information changed for johnsp
# cat /etc/shadow | grep johnsp
johnsp::18192::::::
#

My thoughts are to find another Solaris box, and copy all the relevant password and shadow password files to your 'hosed' server; making backups before you do, and do not log out.

Make sure you know the root password of the second Solaris box.

Also, do the same for the group entries.

Of course, make backups before you do, even if that means just copying the files on the hosed server to filename.bad etc.

If you can get a single root entry working again, you can recreate the others (and issue new passwords).

Make sense?

Or maybe BETTER, can you use pwconv ?

Synopsis - man pages section 1M: System Administration Commands

Description
The pwconv command creates and updates /etc/shadow with information from /etc/passwd.

pwconv relies on a special value of 'x' in the password field of /etc/passwd. This value of 'x' indicates that the password for the user is already in /etc/shadow and should not be modified.

If the /etc/shadow file does not exist, this command will create /etc/shadow with information from /etc/passwd. The command populates /etc/shadow with the user's login name, password, and password aging information. If password aging information does not exist in /etc/passwd for a given user, none will be added to /etc/shadow. However, the last changed information will always be updated.

If the /etc/shadow file does exist, the following tasks will be performed:

Entries that are in the /etc/passwd file and not in the /etc/shadow file will be added to the /etc/shadow file.

Entries that are in the /etc/shadow file and not in the /etc/passwd file will be removed from /etc/shadow.

Password attributes (for example, password and aging information) that exist in an /etc/passwd entry will be moved to the corresponding entry in /etc/shadow.

The pwconv command can only be used by the super-user.

Files
/etc/opasswd
/etc/oshadow
/etc/passwd
/etc/shadow
Attributes
See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Availability
SUNWcsu
See Also
passwd(1), passmgmt(1M), usermod(1M), passwd(4), attributes(5)

Diagnostics
pwconv exits with one of the following values:

0
SUCCESS.

1
Permission denied.

2
Invalid command syntax.

3
Unexpected failure. Conversion not done.

4
Unexpected failure. Password file(s) missing.

5
Password file(s) busy. Try again later.

6
Bad entry in /etc/shadow file.

I overwrite passwd, group from other similar server and ran pwconv, still no luck.
Tried copying /etc/shadow too, no help.

# ls -l /etc/passwd /etc/shadow /etc/group
-rw-r--r--   1 0        sys          715 Oct 22 19:54 /etc/group
-rw-r--r--   1 0        sys         1939 Oct 22 19:54 /etc/passwd
-r--------   1 0        sys          852 Oct 22 19:55 /etc/shadow
#

What happens if you move your shadow files to backup (move not copy them) and run pwconv on the passwd file to create the new shadow files?

Yes, I did same. Initially I copied only passwd and group file from other server and ran pwconv.
Then I copied shadow also from other server.
And yes, I moved all three files, not copied.

Did you disable PAM?

Not sure, if this can help or not. But going with a blog and as per that, I inserted a line " skip-authentication " on top of /etc/pam.conf
But this didn't helped. Things are same still

I'm all out of ideas for the moment.

Maybe someone else will have some good ideas to help!

1 Like

Thanks for trying. I will wait for somebody else to jump in and I will also keep trying

Can you try the following, perhaps it will shed some light :

truss -rall -wall chown root:sys <some insignificant file>

Are you using ZFS ?
Please check if you have some old snapshot of rpool if you are using it.

Regards
Peasant.

2 Likes

This server is on SVM, so that possibility is not an option.
truss output is long, so also attaching that in txt attachment here.

# truss -rall -wall chown root:sys /etc/shadow
execve("/usr/bin/chown", 0xFFBFFE3C, 0xFFBFFE4C)  argc = 3
resolvepath("/usr/lib/ld.so.1", "/lib/ld.so.1", 1023) = 12
resolvepath("/usr/bin/chown", "/usr/bin/chown", 1023) = 14
stat("/usr/bin/chown", 0xFFBFFC18)              = 0
open("/var/ld/ld.config", O_RDONLY)             Err#2 ENOENT
stat("/lib/libcmdutils.so.1", 0xFFBFF6D0)       = 0
resolvepath("/lib/libcmdutils.so.1", "/lib/libcmdutils.so.1", 1023) = 21
open("/lib/libcmdutils.so.1", O_RDONLY)         = 4
mmap(0x00010000, 32768, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_ALIGN, 4, 0) = 0xFF3A0000
mmap(0x00010000, 81920, PROT_NONE, MAP_PRIVATE|MAP_NORESERVE|MAP_ANON|MAP_ALIGN, -1, 0) = 0xFF380000
mmap(0xFF380000, 1540, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_TEXT, 4, 0) = 0xFF380000
mmap(0xFF392000, 352, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_INITDATA, 4, 8192) = 0xFF392000
munmap(0xFF382000, 65536)                       = 0
memcntl(0xFF380000, 1092, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
close(4)                                        = 0
stat("/lib/libc.so.1", 0xFFBFF6D0)              = 0
resolvepath("/lib/libc.so.1", "/lib/libc.so.1", 1023) = 14
open("/lib/libc.so.1", O_RDONLY)                = 4
mmap(0xFF3A0000, 32768, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 4, 0) = 0xFF3A0000
mmap(0x00010000, 1294336, PROT_NONE, MAP_PRIVATE|MAP_NORESERVE|MAP_ANON|MAP_ALIGN, -1, 0) = 0xFF200000
mmap(0xFF200000, 1237013, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_TEXT, 4, 0) = 0xFF200000
mmap(0xFF330000, 35645, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_INITDATA, 4, 1245184) = 0xFF330000
mmap(0xFF33A000, 1416, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANON, -1, 0) = 0xFF33A000
memcntl(0xFF200000, 144992, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
close(4)                                        = 0
stat("/lib/libavl.so.1", 0xFFBFF6D0)            = 0
resolvepath("/lib/libavl.so.1", "/lib/libavl.so.1", 1023) = 16
open("/lib/libavl.so.1", O_RDONLY)              = 4
mmap(0xFF3A0000, 32768, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 4, 0) = 0xFF3A0000
mmap(0x00000000, 8192, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON, -1, 0) = 0xFF3F0000
mmap(0x00010000, 81920, PROT_NONE, MAP_PRIVATE|MAP_NORESERVE|MAP_ANON|MAP_ALIGN, -1, 0) = 0xFF360000
mmap(0xFF360000, 3260, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_TEXT, 4, 0) = 0xFF360000
mmap(0xFF372000, 296, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_INITDATA, 4, 8192) = 0xFF372000
munmap(0xFF362000, 65536)                       = 0
memcntl(0xFF360000, 1096, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
close(4)                                        = 0
mmap(0x00010000, 24576, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON|MAP_ALIGN, -1, 0) = 0xFF350000
munmap(0xFF3A0000, 32768)                       = 0
getcontext(0xFFBFF908)
getrlimit(RLIMIT_STACK, 0xFFBFF8E8)             = 0
getpid()                                        = 6533 [6532]
setustack(0xFF352A88)
brk(0x00022690)                                 = 0
brk(0x00024690)                                 = 0
stat("/platform/SUNW,Netra-240/lib/libc_psr.so.1", 0xFFBFF2B0) = 0
resolvepath("/platform/SUNW,Netra-240/lib/libc_psr.so.1", "/platform/sun4u-us3/lib/libc_psr.so.1", 1023) = 37
open("/platform/SUNW,Netra-240/lib/libc_psr.so.1", O_RDONLY) = 4
mmap(0x00010000, 32768, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_ALIGN, 4, 0) = 0xFF3A0000
munmap(0xFF3A2000, 24576)                       = 0
close(4)                                        = 0
stat("/usr/lib/locale/en_US.ISO8859-1/en_US.ISO8859-1.so.3", 0xFFBFEF90) = 0
resolvepath("/usr/lib/locale/en_US.ISO8859-1/en_US.ISO8859-1.so.3", "/usr/lib/locale/en_US.ISO8859-1/en_US.ISO8859-1.so.3", 1023) = 52
open("/usr/lib/locale/en_US.ISO8859-1/en_US.ISO8859-1.so.3", O_RDONLY) = 4
mmap(0x00010000, 32768, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_ALIGN, 4, 0) = 0xFF340000
mmap(0x00010000, 90112, PROT_NONE, MAP_PRIVATE|MAP_NORESERVE|MAP_ANON|MAP_ALIGN, -1, 0) = 0xFF1E0000
mmap(0xFF1E0000, 19249, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_TEXT, 4, 0) = 0xFF1E0000
mmap(0xFF1F4000, 5778, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_INITDATA, 4, 16384) = 0xFF1F4000
munmap(0xFF1E6000, 57344)                       = 0
memcntl(0xFF1E0000, 8868, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
close(4)                                        = 0
munmap(0xFF340000, 32768)                       = 0
brk(0x00024690)                                 = 0
brk(0x00028690)                                 = 0
getuid()                                        = 0 [0]
getpid()                                        = 6533 [6532]
open("/proc/6533/psinfo", O_RDONLY)             = 4
read(4, 0xFFBFF938, 336)                        = 336
  02\0\0\0\0\0\001\0\01985\0\01984\0\01984\0\0\097\0\0\0\0\0\0\0\0
  \0\0\0\0\0\0\0\0\0\0\0\0\0\006 h\0\004  \0\0\0\0\0\0\0\0\003\0\b
   ]AFD8 :18 e 4DE\0\0\0\0\0 JAE (\0\0\0\0\0\0\0\0 c h o w n\0\0\0
  \0\0\0\0\0\0\0\0 c h o w n   r o o t : s y s   / e t c / s h a d
   o w\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
  \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\003
  FFBFFE <FFBFFE L01\0\0\0\0\0\001\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
  \0\0\019\0\0\0\0\0\0\0\0\0\0\001\0\0\0\0\0\0\0\0\006 O14\003 (\0
  \0\0\0 ;\003\0\0 ]AFD8 :\0\0\0\0\0\0\0\0\0 JAE ) T S\0\0\0\0\0\0
  \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\001FFFFFFFFFFFFFFFF\0\0\0\0
  \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
close(4)                                        = 0
mmap(0x00010000, 65536, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON|MAP_ALIGN, -1, 0) = 0xFF1C0000
getuid()                                        = 0 [0]
getuid()                                        = 0 [0]
open64("/var/run/name_service_door", O_RDONLY)  Err#2 ENOENT
open("/etc/nsswitch.conf", O_RDONLY|O_LARGEFILE) = 4
fcntl(4, F_DUPFD, 0x00000100)                   = 256
close(4)                                        = 0
read(256, 0xFF352400, 1024)                     = 961
   #\n #   C o p y r i g h t   2 0 0 6   S u n   M i c r o s y s t
   e m s ,   I n c .     A l l   r i g h t s   r e s e r v e d .\n
   #   U s e   i s   s u b j e c t   t o   l i c e n s e   t e r m
   s .\n #\n #   i d e n t\t " @ ( # ) n s s w i t c h . f i l e s
  \t 1 . 1 4\t 0 6 / 0 5 / 0 3   S M I "\n\n #\n #   / e t c / n s
   s w i t c h . f i l e s :\n #\n #   A n   e x a m p l e   f i l
   e   t h a t   c o u l d   b e   c o p i e d   o v e r   t o   /
   e t c / n s s w i t c h . c o n f ;   i t\n #   d o e s   n o t
     u s e   a n y   n a m i n g   s e r v i c e .\n #\n #   " h o
   s t s : "   a n d   " s e r v i c e s : "   i n   t h i s   f i
   l e   a r e   u s e d   o n l y   i f   t h e\n #   / e t c / n
   e t c o n f i g   f i l e   h a s   a   " - "   f o r   n a m e
   t o a d d r _ l i b s   o f   " i n e t "   t r a n s p o r t s
   .\n\n p a s s w d :     f i l e  \n # p a s s w d _ c o m p a t
   :\t f i l e s\n g r o u p :             f i l e s\n h o s t s :
     f i l e s   d n s\n i p n o d e s :         f i l e s\n n e t
   w o r k s :       f i l e s\n p r o t o c o l s :     f i l e s
  \n r p c :                 f i l e s\n e t h e r s :           f
   i l e s\n n e t m a s k s :       f i l e s\n b o o t p a r a m
   s :   f i l e s\n p u b l i c k e y :     f i l e s\n #   A t
   p r e s e n t   t h e r e   i s n ' t   a   ' f i l e s '   b a
   c k e n d   f o r   n e t g r o u p ;     t h e   s y s t e m
   w i l l  \n #       f i g u r e   i t   o u t   p r e t t y   q
   u i c k l y ,   a n d   w o n ' t   u s e   n e t g r o u p s
   a t   a l l .\n n e t g r o u p :       f i l e s\n a u t o m o
   u n t :     f i l e s\n a l i a s e s :         f i l e s\n s e
   r v i c e s :       f i l e s\n p r i n t e r s :\t u s e r   f
   i l e s\n\n a u t h _ a t t r :     f i l e s\n p r o f _ a t t
   r :     f i l e s\n p r o j e c t :         f i l e s\n\n t n r
   h t p :           f i l e s\n t n r h d b :           f i l e s
  \n
mmap(0x00010000, 65536, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON|MAP_ALIGN, -1, 0) = 0xFF1A0000
read(256, 0xFF352400, 1024)                     = 0
close(256)                                      = 0
stat("/lib/nss_files.so.1", 0xFFBFF558)         = 0
resolvepath("/lib/nss_files.so.1", "/lib/nss_files.so.1", 1023) = 19
open("/lib/nss_files.so.1", O_RDONLY)           = 4
mmap(0x00010000, 32768, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_ALIGN, 4, 0) = 0xFF340000
mmap(0x00010000, 106496, PROT_NONE, MAP_PRIVATE|MAP_NORESERVE|MAP_ANON|MAP_ALIGN, -1, 0) = 0xFF180000
mmap(0xFF180000, 27106, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_TEXT, 4, 0) = 0xFF180000
mmap(0xFF198000, 1792, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_INITDATA, 4, 32768) = 0xFF198000
munmap(0xFF188000, 65536)                       = 0
memcntl(0xFF180000, 6392, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
close(4)                                        = 0
stat("/lib/libsocket.so.1", 0xFFBFF490)         = 0
resolvepath("/lib/libsocket.so.1", "/lib/libsocket.so.1", 1023) = 19
open("/lib/libsocket.so.1", O_RDONLY)           = 4
mmap(0xFF340000, 32768, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 4, 0) = 0xFF340000
mmap(0x00010000, 122880, PROT_NONE, MAP_PRIVATE|MAP_NORESERVE|MAP_ANON|MAP_ALIGN, -1, 0) = 0xFF160000
mmap(0xFF160000, 44594, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_TEXT, 4, 0) = 0xFF160000
mmap(0xFF17C000, 4277, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_INITDATA, 4, 49152) = 0xFF17C000
munmap(0xFF16C000, 65536)                       = 0
memcntl(0xFF160000, 14320, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
close(4)                                        = 0
stat("/lib/libnsl.so.1", 0xFFBFF490)            = 0
resolvepath("/lib/libnsl.so.1", "/lib/libnsl.so.1", 1023) = 16
open("/lib/libnsl.so.1", O_RDONLY)              = 4
mmap(0xFF340000, 32768, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 4, 0) = 0xFF340000
mmap(0x00010000, 729088, PROT_NONE, MAP_PRIVATE|MAP_NORESERVE|MAP_ANON|MAP_ALIGN, -1, 0) = 0xFF080000
mmap(0xFF080000, 595342, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_TEXT, 4, 0) = 0xFF080000
mmap(0xFF122000, 33761, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_INITDATA, 4, 598016) = 0xFF122000
mmap(0xFF12C000, 23248, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANON, -1, 0) = 0xFF12C000
munmap(0xFF112000, 65536)                       = 0
memcntl(0xFF080000, 89668, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
close(4)                                        = 0
mmap(0x00000000, 8192, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON, -1, 0) = 0xFF1F0000
munmap(0xFF1F0000, 8192)                        = 0
mmap(0x00000000, 8192, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON, -1, 0) = 0xFF1F0000
munmap(0xFF1F0000, 8192)                        = 0
munmap(0xFF340000, 32768)                       = 0
sigfillset(0xFF3392F0)                          = 0
brk(0x00028690)                                 = 0
brk(0x0002C690)                                 = 0
open("/etc/group", O_RDONLY|O_LARGEFILE)        = 4
fcntl(4, F_DUPFD, 0x00000100)                   = 256
close(4)                                        = 0
read(256, 0x0002C150, 1024)                     = 712
   r o o t : : 0 :\n o t h e r : : 1 : r o o t\n b i n : : 2 : r o
   o t , d a e m o n\n s y s : : 3 : r o o t , b i n , a d m\n a d
   m : : 4 : r o o t , d a e m o n\n u u c p : : 5 : r o o t\n m a
   i l : : 6 : r o o t\n t t y : : 7 : r o o t , a d m\n l p : : 8
   : r o o t , a d m\n n u u c p : : 9 : r o o t\n s t a f f : : 1
   0 :\n d a e m o n : : 1 2 : r o o t\n s y s a d m i n : : 1 4 :
  \n s m m s p : : 2 5 :\n g d m : : 5 0 :\n w e b s e r v d : : 8
   0 :\n p o s t g r e s : : 9 0 :\n n o b o d y : : 6 0 0 0 1 :\n
   n o a c c e s s : : 6 0 0 0 2 :\n n o g r o u p : : 6 5 5 3 4 :
  \n p r o d a d m : : 1 6 6 6 7 :\n o e u s e r : : 1 6 6 6 6 :\n
   p r o d s e : : 5 0 0 0 0 :\n o s i r i s : : 5 0 0 3 1 :\n t d
   r a d m : : 1 6 7 0 1 :\n e s p a d m : : 1 6 7 0 2 :\n p d e a
   d m : : 1 6 7 0 3 :\n n e n a a d m : : 1 6 7 0 4 :\n p a m a d
   m : : 1 6 7 0 5 :\n r o u t a d m : : 1 6 7 0 6 :\n t i m e s t
   e n : : 4 0 0 0 2 :\n a l i a d m : : 1 6 7 0 8 :\n x y e x p o
   r t : : 1 0 7 :\n o d b c : : 1 7 7 7 6 : t i m e s t e n , p r
   o d a d m , t d r a d m , r o u t a d m , e s p a d m , p d e a
   d m , x y e x p o r t , a l i a d m , m p c a d m , e s x k a d
   m , a l i n k a d m\n o p c g r p : : 1 7 7 :\n e s x k a d m :
   : 1 6 7 1 1 :\n m p c a d m : : 1 6 7 0 9 :\n a l i n k a d m :
   : 1 6 7 1 2 :\n j o h n s p : : 1 0 0 2 :\n + @ I D S : : : : :
   :\n + @ W T A : : : : : :\n + @ N S S : : : : : :\n + @ T I E R
   2 : : : : : :\n
close(256)                                      = 0
getuid()                                        = 0 [0]
getuid()                                        = 0 [0]
open64("/var/run/name_service_door", O_RDONLY)  Err#2 ENOENT
stat("/lib/nss_file.so.1", 0xFFBFF5B8)          Err#2 ENOENT
stat("/usr/lib/nss_file.so.1", 0xFFBFF5B8)      Err#2 ENOENT
fstat64(2, 0xFFBFEE00)                          = 0
chown: unknown user id write(2, 0x00011718, 23)                 = 23
   c h o w n :   u n k n o w n   u s e r   i d
rootwrite(2, " r o o t", 4)                             = 4

write(2, "\n", 1)                               = 1
_exit(2)
#

UPDATE ---- Just found that /etc/nsswitch.conf had file instead of files. So stupid mistake.
I corrected it and then I can see root user, when I issue id command.

1 Like