Description

This article provides the steps required to reset CTP shell user login passwords from single user mode.

Symptoms

Unable to login to the CTP shell (console or SSH) due to a bad password or cannot recall the password

Solution

The steps required to reset shell user passwords change from time to time when software updates occur.  In this case, the kernel has changed to Wind River in the 9.x CTPOS release(s). 

Take the following steps to reset the root or other shell user passwords if your CTP is running 9.0R1 or higher releases.

Note: Console access is required to interrupt the boot process and enter single user mode. Before performing the following steps, obtain local console access or access through a terminal server to be able to reset the CTP root password or other user passwords.

  1. Power up the CTP (150,151 2008, 2024, 2056).  

  2. When the GRUB Loader box is displayed, press ' e ' to enter edit mode.  You should see the following:

    /--------------------------------------------------------------------------------\
     |setparams 'CTPOS WRLv7 '                                                       |
     |                                                                               |
     |        search --no-floppy --label --set=root CTP_ROOT                         |
     |        linux        /boot/vmlinuz root=LABEL=CTP_ROOT console=ttyS0,9600n8\   |
     | nodmraid intel_iommu=off                                                      |
     |        initrd        /boot/WR_Linux_initrd-v02.cpio.gz                        |
     |                                                                               |
     |                                                                               |
     |                                                                               |
     \-------------------------------------------------------------------------------/
  3. Press the down arrow to get to the line starting with "kernel" (for CTP2000), or "linux" (for CTP151) and press "e" again.

  4. Press the right arrow key to navigate to the end of that line (ends with "iommu=off"), press the space bar, type “init=/bin/bash,” and then press return.

  5. Enter Ctrl X (for CTP151), or enter "b" (for a CTP2000) to boot into single user mode.

  6. The CTP should boot to the "bash-4.3#" prompt.

    Note: The "LABEL" in the next command is derived from the label seen in the grub loader line that starts with "linux" or "kernel," above. In this example, the label is "CTP_ROOT" but it could also be "CTP_ROOT_2," enter the label you see in the grub loader.

  7. Enter /bin/mount LABEL=CTP_ROOT /flash_root to mount the flash_root directory.

  8. Enter /usr/bin/passwd and enter the new root password. The message "passwd: password updated successfully," should display.

  9. Enter /usr/bin/passwd ctp and enter the new ctp user password. The message "passwd: password updated successfully," should display.

  10. Enter /usr/bin/passwd ctp_cmd and enter the new ctp_cmd user password. The message "passwd: password updated successfully," should display.

  11. Enter cp /etc/shadow /flash_root/etc/shadow to copy the shadow file to the flash.

  12. Enter /bin/umount /flash_root to unmount the flash_root directory.

  13. Enter /sbin/reboot –f to reboot the CTP.

  14. When the CTP has finished rebooting, log in to verify that the change is successful.

Example Output

bash-4.3# /bin/mount LABEL=CTP_ROOT /flash_root
bash-4.3# passwd     (repeat these password commands for ctp and ctp_cmd)
Changing password for user root.
New password:
Retype new password:
passwd: passwd: password updated successfully
bash-4.3# cp /etc/shadow /flash_root/etc/shadow
bash-4.3# /bin/umount /flash_root
bash-4.3# /sbin/reboot -f

Modification History

2023-12-14: Updated article to reflect current information