New user issue on Solaris

Posted on 2006-03-31
Last Modified: 2013-12-27
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.

Question by:mehranalmasi
    LVL 14

    Expert Comment

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

    Accepted Solution

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

    Assisted Solution

    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.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
    Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now