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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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...
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.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Unix OS

From novice to tech pro — start learning today.