SEO, Internet Marketing, Search Engine Optimization, Search Engine Marketing by www.websquash.com

Basic Knowledge of UNIX- User Management

USER and GROUP

User and group









  Users are the primary agents on the system. Each User is required to log in to the system.The User supplies the User name of an account and a corresponding password (on a secure system, all accounts either have passwords or are invalidated) . If the password is correct, the User is logged in to that account; the User acquires the access rights and privileges of the account.

-Groups are collections of Users who can share access permissions for protected resources. A Group has an ID, and a group is composed of members and administrators. The creator of the group is usually the first administrator.

-An attribute is a characteristic of a User or a group that defines the type of functions that a user or a group can perform. These can be extraordinary privileges, restrictions, and processing environments assigned to a user.

-Their attributes control their access rights, environment, how they are authenticated, and how, when, and where their accounts can be accessed. These attributes are created from default values when a user is created through a create user command. Then can be altered by using a special command.

-User root is also called administrator. It has the super right to UNIX system.

------------------------------------------------------------------------------------------------------------

su - Switch User Id

- Syntax :   su[-] [username] - Changes the user ID associated with a session.
-Examples:
      # su informix
   This command runs a subshell with the effective user ID and privileges of informix without informix's environment variable

     # su - informix

     Switch current user to informix user and start a subshell using informix's login environment

    - $ su

    Switch current user to the super user root

  Environment variables have many Functions, for example, setting the home directory of current user, using the default shell of current user and so on.

-------------------------------------------------------------------------------------------------------------


How to Add a Group ?

1. HP-UX/Solaries

      Syntax :

     groupadd [-g gid] group - add a new group to the system

   EX :

    #groupadd -g 101 informix

    Add the group informix with the group ID 101

   ** Note : Group ID should be unique .

  Description :
  - g   : Specifies the group ID for the new group.
  - gid : must be a non-negative decimal integer less than MAXUID as defined in the <param.h> header file. By default the next available unique group ID in the valid range is allocated. Group IDs in the range 0 - 99 are reserved.

 - Different mini computers have different commands to add a new group.
 - Note : Only those users who have the super right to the system can use this command.


 2.AIX

    Syntax :

    mkgroup [id=gid] group - Creates a new group.

    EX :  #mkgroup id=101 informix

    Add the group informix with the group ID 101

  ** Note : Group ID should be unique.

    Description :

- id     : Initializes a group with a specific attribute.
-Note  : Only those users who have the super right to the system can use this command.

-------------------------------------------------------------------------------------------------------------

How to Add a User ?

1. HP-UX / Solaris

     Syntax :

    useradd [-u uid] [-g group] [-d dir] [-s shell] [-c comment] [-m] username

     - add a new user login to the system

   EX:

#useradd -u 555 -g employee -d /opt/dara -m -s /sbin/csh dara

   Add the user dara to the system with a UID of 555, base directory /opt/dara,  /sbin/csh as its default shell, and a primary group of employee.


   Description :


  •  -u    :  Specifies the UID for the new user, uid must be non-negative decimal integer less than MAXUID as it is defined in the <param.h> header file. uid defaults to the next available unique number above the maximum currently assigned number. UIDs from 0 - 99 are reserved.
  • -g    : Specifies the integer group ID or character string name of an existing group. This defines the primary group membership of the new login, The default for this option can be reset by invoking useradd -D -g group.
  • -d   : Specifies the home directory of the new login. It defaults to base_dir/login , where login is the new login and base_dir is the base directory for new login home directories.
  • -s   : Specifies the full pathname of the new login shell. The default is an empty field, which causes the system to use  /sbin/sh as the login shell. The value of shell must be a valid executable file.
  • -c   : Specifies the comment field present in the   /etc/passwd   entry for this login. This can be any text string. A short description of the new login is suggested for this field.
  • -m   : Creates the home directory for the new login if it does not exist. If the home directory exists, the directory must have read and execute permission by group , where group is the primary group of the new login.
  • Different mini computer has different commands to add a new user.
  • Note:  Only those users who have the super right to the system can use this command.

 2. AIX 

     Syntax  : 

    mkuser [id=uid] [pgrp=group] [home=homedir] [shell=shellname] username

    -Creates a new user account

    # mkuser id=111 pgrp=boss home=/opt/dara shell=/bin/csh dara

    Add the user dara to the system with a UID of 111, base directory /opt/dara , /bin/csh as its default shell, and a primary group of employee.


    Description : 

  • id   : Specifies the user ID, The value parameter is a unique integer string. Changing this attribute compromises system security and, for this reason, you should not change this attribute.
  • pgrp   : Identifies the groups the user belongs to , The value parameter is a comma-separated list of group names.
  • home     : Identifies the home directory of the user specified by the Name parameter. The value parameter is a full path name.
  • shell   : Defines the program run for the user at session initiation. The value parameter is a full path name.
  • Note :  Only those users who have the super right to the system can use this command.

-----------------------------------------------------------------------------------------------------------------


listusers



    Syntax  : 

       listusers - list user login information

   Examples : 

      # listusers

    List user login information . 

    Result :

     informix
     scu
     sms
     smp


   -  For HP-UX , Solaris and AIX use the same command.

------------------------------------------------------------------------------------------------------------------

passwd

     Syntax : 

      passwd - change login password and associated attributes

     Example : 

       # passwd sms

      Change the password for user sms.

     Description :


  •    HP-UX, Solaris and AIX use the same command to set the password.
  • Note : Only those who have the super right to the system can modify the other user's password. Otherwise, they can only modify their own password.
-----------------------------------------------------------------------------------------------------------------------




 
Share on Google Plus

About Unknown

0 comments:

Post a Comment

If there is any comments,Please leave a comment at here.

loading...
Sponsor by