4. Accounts

Users need the first two of the following for their accounts, while the system needs 3-7: (3 minimum, 7 maximum)

  1. User ID or login name or username (all the same thing) which should meet the following criteria:
    1. Unique (not already in use)
    2. Lowercase
    3. 1st character a-z
    4. 1-8 characters
  2. Password (6-8 characters)
  3. UID (user ID)
    1. Must be unique
    2. 0-99 are reserved for the system, 100 – 6000 can be used
  4. Primary group (only one can be assigned) or Secondary group (1-15 different ones) groups permissions are assigned to files and allow access
  5. GCOS (for comments or user’s full name)
  6. Home –checks when you begin, files in here you own (this is your home directory) this field is usually /export/home/username
  7. Shell – sh,ksh,csh, rsh (restricted shell), specific.commands, etc (this is what shell the user initially uses) to make a special shell put the command you want, usually in /usr/bin/sh, /bin, or /usr/sbin/csh.

All of the preceding information is in the /etc/passwd file. So if you type more /etc/passwd you will see this: (example user) Joe:x:100:10:Joe Smith:/export/home/Joe:/usr/bin/ksh
1 2 3 4 5 6 7

The above numbers show which field is what in the listing (if the numbers don't align below the section on your browser, just count by each colon (:) so Joe is 1, x is 2, 100 is 3, etc.) Some common groups are: staff, nobody, other, sysadmin, sys, and adm.
Note: The password will not show for security. The password is kept in /etc/shadow and is encrypted. When logged in as root (/) you are put in a special Bourne shell.

There are three ways to add users:

  1. Edit the following files: /etc/passwd – 6 parts to edit /etc/shadow – password is kept in this /etc/group – secondary groups are here You will also need to create a home directory and create ownership
  2. useradd command
  3. admintool – a feature in Solaris that gives you a graphical user interface (GUI) to add user accounts.

For text files there are records, fields and comments and a “:” (colon) usually separates the fields, this is considered the format of files (including etc/passwd.)

To make a user using option 1:

Edit the files listed to reflect the new user, and make a home directory. To make a home directory (for fictional user joe) do this:
      cp –r /etc/skel export/home/joe
(the /etc/skel is a default profile you make, can also be called whatever you want) or mkdir /export/home/joe

To make a user using option 2:

Type useradd then uses the following options:

The entire command will look like this (type on one line): useradd –u 1001 –g 10 –c “joe shmoe” –s /usr/bin/ksh –d /export/home –m –k /etc/skel joe (the user name will be put last)

Option 3 to create a user, is to use the admintool, which is a GUI based tool, that is self-explanatory and is very easy to use.

To change a group - chgrp –r [group you want i.e. adm] /export/home/joe

To make a password - passwd joe (you will then be prompted to enter a password)

Ways to check your new account:


  Go to Chapter 3       Go to Index        Go to Chapter 5