"User 'root is not authorized to run this command'" While enabling Shell on VCSA SSH.
search cancel

"User 'root is not authorized to run this command'" While enabling Shell on VCSA SSH.

book

Article ID: 390731

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

Symptoms:

  • Root authentication on VCSA works on SSH, but enabling Shell failed.

  • You will see the error from the VCSA console or a putty terminal: User 'root is not authorized to run this command'

Environment

VMware vCenter Server Appliance 7.0.x
VMware vCenter Server Appliance 8.0.x

Resolution

  • Take a snapshot or backup of the vCenter Server Appliance before proceeding.
    Caution: Do not skip this step and take a power off Snapshots of all vCenters in linked mode.

  • Note: If the vCenter Appliance is on the same ESXi hosts, it manages. Connect directly to the ESXi host that it is located on to perform these steps.
  • Reboot the vCenter Server Appliance.
  • After the VCSA Photon OS starts, press the e key to enter the GNU GRUB Edit Menu.
  • Locate the line that begins with the word Linux.
  • Append these entries to the end of the line -
    rw init=/bin/bash
    The line should look like the following screenshot:

 

  • Press F10 to continue booting.
  • Run the command -
    mount -o remount,rw /
  • Modify and save the vCenter's /etc/passwd first line from root:x:0:0:root:/root:/bin/appliancesh to root:x:0:0:root:/root:/bin/bash with a vi command.
  • Unmount the filesystem by running this command: umount /
  • Reboot the vCenter Server Appliance by running this command: reboot -f