Can't login as root

After upgrading infrastructure, as described in the blog, default login account has changed to ec2-user.
To administer the instance, I need to login as root but I can’t because I’m asked root’s password when trying to “su”, “sudo”, or “passwd”. Before upgrade, I only accessed with SSH key and hadn’t set password for root.
How can I get root password? or Is there other way to login as root?

This is an option:

https://aws.amazon.com/articles/5213606968661598

Unfortunately AWS will not, as far as I can find anyway (I’ve looked), let
you modify the root user’s authorized_keys file unless you SSH in and do
it yourself. Instead the option above lets you build a new box, attach
the old system’s disk to it, and then you can hack in your key and then
move the old disk back to the old system and fire it up. Not hard, just
take fifteen minutes or so.


Good luck.

If you find this post helpful and are logged into the web interface,
show your appreciation and click on the star below…

sudo -i should work, I am pretty certain that was tested.