Need help with user creation

Hello guys,

i have a problem where i cant create a user and here some problem that i encounter.

  1. /etc/passwd seems locked.
  2. getting this error UX: useradd: ERROR: Cannot update system files - login cannot be created.
# useradd -u 47367 -g 1084 -c "user123" -d /local/home/user123 -s /bin/ksh -m user123
UX: useradd: ERROR: Cannot update system files - login cannot be created.
# ls -ld passwd ; ls -ld shadow
-rw-r--r--   1 root     sys        21192 Feb 25 05:21 passwd
-r--------   1 root     sys        11151 Mar  9 23:23 shadow
#

When i run pwck, i encounter this.

# pwck

lp:x:71:8:Line Printer Admin:/usr/spool/lp:
        Login directory not found

uucp:x:5:5:uucp Admin:/usr/lib/uucp:
        Login directory not found

nuucp:x:9:9:uucp Admin:/var/spool/uucppublic:/usr/lib/uucp/uucico
        Login directory not found
        Optional shell file not found

sitescope:x:64101:64101:userabc (userabc@abc.com):/local/home/userabc:/bin/sh
        Logname too long/short

but as per based on no1 problem, i cannot edit /etc/passwd. Looks like / is OK.

Filesystem            kbytes    used   avail capacity  Mounted on
/dev/md/dsk/d1       6197861 2263849 3872034    37%    /

the needed files for useradd also available.

# for i in datemsk passwd shadow group skel user_attr;
> do
> file /etc/$i
> done
/etc/datemsk:   ascii text
/etc/passwd:    ascii text
/etc/shadow:    ascii text
/etc/group:     ascii text
/etc/skel:      directory
/etc/user_attr: ascii text

Looking forward any suggestion from you guys.

You should be root to do this.
Use the useradd like this and see

useradd -u 47367 -g 18 -d /local/home/user123 -m -s /bin/ksh -c "user123"  user123

/local/home dire should be present, there should be no conflicting uid 47367 in the /etc/passwd file.you can grep to check. group 18 should be a valid group too. Whats your OS version, showrev ?
SEEMS like this file /etc/user_attr is missing or been deleted. Restore it and try

1 Like

thank you, it helped me...