I'm trying to connect to an EC2 AWS instance but when I tried to install PHPMYADMIN the linux console asks me for the root user password, which I forgot about. Could anyone please know how to use .PEM file to login as the root user? I tried sudo su command but it still asks me for the root user. Any help is appreciated.
Disclaimer: It is not recommended to login as root.
But still if you want to, then:
PermitRootLogin
in /etc/ssh/sshd_config
/home/ec2-user/.ssh/authorized_keys
to /root/.ssh/authorized_keys
Now you should be able to login as root using the .pem key.
You don't need your root password if you are running sudo su -
, you need the password of the user you are running the sudo command as. Provided that the user has sudo privileges as root. Then you can just run as root:
yum install phpmyadmin
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.