To login to AWS linux machine images, one has to use public/private key pairs. There are no passwords, so no way to gain root access. But, since the user with which we login has administrator privileges (ec2-user), using 'sudo' command doesn't require any password. So, to go to root user,…