• Solaris Useradd Syntax

    This morning I’ve been installing a new Sun Fire V240, and like always, I couldn’t remember the syntax to add a user to the system. Unlike other flavors of UNIX, Solaris does not have a command like adduser which walks you through the process step-by-step, so you have to remember the four flags useradd requires, and in what order it expects to receive them. Since I don’t manually add users unless I’m installing a new server, I don’t run the command enough to remember the syntax.

    Anyhow, so I always know where to find the syntax, and in the hopes of helping others who might find themselves forgetting it, here it is:

    useradd -g group -c ‘User Name’ -d /path/to/home/directory -s /path/to/shell username

    Should you need to create a new group, it’s easy:

    groupadd groupname

    This entry was posted on Thursday, September 8th, 2005 at 10:37 am and is filed under Data and Technology. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
  • 11 Comments

    Take a look at some of the responses we have had to this article.

    1. gopi
      Feb 21st
      Reply

      useradd

    2. Oct 11th
      Reply

      Very good! how do I enter a expiry date for useradd.

      http://www.jouwnieuws.nl

    3. Interessando, luogo abbastanza luminoso, penso +5

    4. Mansoor
      Dec 2nd
      Reply

      Good example.

      Very helpful.

    5. Thank you, i was searching the AddUser command :P

    6. Vadivel
      Mar 3rd
      Reply

      1. How to identify the existing groups and users?
      2. How to identify the particular user is available in which group?

      Please send the answers for the below mail id

      hpvaadi@hp.com

    7. Praveen
      Apr 3rd
      Reply

      Why useradd takes so much of time on high end machines ??

      # ptime useradd -g other -d /tmp/testuser -s /bin/csh testuser

      real 55.317
      user 0.806
      sys 1.088

      is ther any way to make it faster ?

    8. Abi Akinboro
      Jun 6th
      Reply

      Extremely helpful!!! I was searching the AddUser command so this came in so handy. Well done…

    9. [...] Unlike other flavors of UNIX, RHEL does not have a command like adduser which walks you through the process step-by-step, so you have to remember the four flags useradd requires, and in what order it expects to receive them. Since I don’t manually add users unless I’m installing a new server, I don’t run the command enough to remember the syntax… It’s basically the same as it is on Solaris. [...]

    10. Jan 15th
      Reply

      The packet and iheld it moved her back and out milf porn as.

    11. kytulq
      Mar 13th
      Reply

      What i like yousaid, and he had liked what theydid.

  • Leave a Reply

    Let us know what you thought.

  • Name(required):

    Email(required):

    Website:

    Message: