[Help] Linux AWS EC2 ec2-user

kiks

Power Member
Joined
Jan 15, 2017
Messages
739
Reaction score
623
I created an AWS AMI linux ec2 instance and Im log-inning as an ec2-user. If I try to login as root it gives me an error that it is advised to get connected as ec2-user . I get errors in whatever command I run, i found some articles for path variable But I cannot make it work.

Kzn5P7m
 
Apt get doesn't work with AMI.
You need to use
yum update
Thanks but it says "You need to be root to perform this command." . if I login as root it closes automatically after it says "it's better to login as ec2-user rather than root"
 
Thanks but it says "You need to be root to perform this command." . if I login as root it closes automatically after it says "it's better to login as ec2-user rather than root"
You should login as ec2-user. When trying to run update/ install command, you can just prepend it with sudo. Like in your case, you should be able to run

Code:
sudo yum update

If that doesn't work, ssh using your ec2-user and try running
Code:
sudo su

It will open root user bash. You can then fire command inside that shell.

You cannot ssh directly to EC2 using root user.
 
Thread moved.
 
sudo yum update
this should work i think
 
Back
Top