New user issue on Solaris

Hi Experts,

here is intro. when connecting by ssh.

> uname -a
SunOS 5.6 Generic_105181-30 sun4u sparc SUNW,ULtra-5_10

I edited the passwd file and created a new user:

Also group file:

if I do:
>su test
I get:
which means I have logged in as test.

here is the problem, when I su as root and do"
>passwd test
I get
passwd(SYSTEM): test does not exist
Permission denied

I have tried it for another new account with same result.
Please help me understand what the problem is and how can I fix this.

thanks in advance.

Who is Participating?
Please don't edit /etc/passwd unless you have to - there is a risk of corrupting it so noone can log in. Remove the line you created in the pasword file and use "useradd" instead:

useradd -u 1018 -g  600 -c test -d /home/test -m -s /usr/bin/bash test

"useradd" checks the uid isn't a duplicate, creates the entries in /etc/passwd, /etc/shadow & /etc/group, creates the home directory with correct ownership & permissions & copies the default .profile etc. Faster than doing it all manually and will less risk.
su test

does not mean you logged in as test.

I think that the problem is that you did not create an entry in the /etc/shadow file for your new user.  Solaris requires an entry in passwd and in shadow

Just copy an existing line and change the user to test and the uid to whatever you used in passwd...
If you add just an entry to /etc/passwd and not /etc/shadow, then you need to run


which will create a /etc/shadow entry for any missing /etc/passwd entries.

You really should use 'useradd' to add users.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.