IBM Support

How to Restore the AIX Root User ID

How To


Summary

If the root user has been deleted, it is always recommended that you restore your system from the most recent good mksysb.
If you do not have a good mksysb, you may be able to restore the id.

Objective

Describe the steps to boot from maintenance mode and restore the root user id.

Steps

1)  First, it is possible the id was renamed.  Check for for user id 0 and group id 0 in /etc/passwd file.
  • Example:  some_other_userid:!:0:0
If this exists, then correct this entry:
su some_other_userid
vi /etc/passwd
CHANGE:
- some_other_userid:!:0:0
+ root:!:0:0
vi /etc/security/passwd
CHANGE:
- some_other_userid:
+root:
If there is no user/group id 0, then you will need to boot in to maintenance mode to recreate this entry.
2)  Boot in to maintenance mode
3) When you come to the following step in booting into maintenance mode please select option 1
Type the number of your choice and press Enter.
   1) Access this Volume Group and start a shell
**2) Access this Volume Group and start a shell before mounting filesystems
4)  Add the root user 
vi /etc/passwd:
Add the following line:
root:!:0:0::/:/usr/bin/ksh
5) Check /etc/group to ensure the system group exists. If not, add it:
vi /etc/group
Add the following line:
system:!:0:root  
6)  Check /etc/security/group to ensure the system group exists. If not, add it:
vi /etc/security/group
Add the following lines:
system:
        admin = true 
7)  Set the password for root
passwd root
** Set a temporary password, since you will need to change this at first login.
8)  Reboot the system and login as root

Additional Information

SUPPORT

If additional assistance is required after completing all of the instructions provided in this document, please follow the step-by-step instructions below to contact IBM to open a case for software under warranty or with an active and valid support contract.  The technical support specialist assigned to your case will confirm that you have completed these steps.

1.  Document and/or take screen shots of all symptoms, errors, and/or messages that might have occurred. 

2.  Capture any logs or data relevant to the situation.

3.  Contact IBM to open a case:

   -For electronic support, please visit the IBM Support Community:
     https://www.ibm.com/mysupport
   -If you require telephone support, please visit the web page:
      https://www.ibm.com/planetwide/

4.  Provide a good description of your issue, and reference this Technote, and any issues you had with the instructions.

5.  Collect the system snap and upload all of the details and data for your case.

To collect a complete snap of your system information:

5.1) Remove previously gathered data

   # snap -r 

5.2) Copy related files from #1 and #2 to the snap data directory

   # mkdir -p /tmp/ibmsupt/testcase
   # cp <logs, screenshots, etc> /tmp/ibmsupt/testcase

5.3) Run the snap command with one of the following options to collect all info.

     * If you have already engaged with a support engineer, use the flags specified by your support team.

   # snap -aZc (Omits system dump data)   
     OR 
   # snap -ac (Use if system dump data is needed)

5.4) Rename the testcase to include your case number to ensure it is properly attached to your case

  # mv /tmp/ibmsupt/snap.pax.Z /tmp/ibmsupt/yourcase#[.optional_description].snap.pax.Z

5.5) Upload the file by one of the following options (a, b, or c)

     a) Attach to your case
     https://www.ibm.com/mysupport/s/my-cases

     b) Upload to the Enhanced Customer Data Repository(ECuRep) 
     https://www.secure.ecurep.ibm.com/app/upload_sf

     c) Upload to the Blue Diamond FTP server (Blue Diamond Customers Only)
     https://msciportal.im-ies.ibm.com

* Note: For information about blue diamond upload see:

     http://www.ibm.com/support/docview.wss?uid=nas8N1020947

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG10","label":"AIX"},"Component":"","Platform":[{"code":"PF002","label":"AIX"}],"Version":"All Versions","Edition":"","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}}]

Document Information

Modified date:
06 May 2019

UID

ibm10883524