O Amazon Linux AMI User Guide explica que você pode usar o sudo para executar comandos como root, por exemplo, sudo whoami
:
How do I get root SSH access on my Amazon Linux AMI instance?
The Amazon Linux AMI does not allow remote root SSH by default. You should specify a keypair at instance launch and login as ‘ec2‐user’ using your keypair to access the command line. This user has sudo access by default to allow you to run root actions. If you wish to enable remote root login, please be aware that it is significantly less secure than relying on keypairs and a secondary user.