Sometimes you don’t know or want to change the root password to be able to log into WHM as root (yes I know you shouldn’t log in as root, but sometimes you do). Here’s the command to do that via CLI

whmapi1 create_user_session user=root service=whostmgrd locale=en

This will return something like to following

data:
  cp_security_token: /cpsess9427258339
  expires: '1596644759'
  locale: en
  service: whostmgrd
  session: root:J7omtbeEeUhJ9yPK:create_user_session,yAs86MVYrHT46avjRLAGxhHaEFrFV3Hf
  url: https://server.domain.com:2087/cpsess9427258339/login/?locale=en&session=root%2UtnqjEJVUBNo2JnKH%3acreate_user_session%55nNCwxRW4tzqEe6NUYKwWrDM7N485TiYA
metadata:
  command: create_user_session
  reason: Created session
  result: 1
  version: 1

You will use the URL and it will take you right into WHM