Page 1 of 1

How to gain root access to the NLS AWS EC2 AMI?

Posted: Thu Mar 31, 2016 8:57 am
by Dante
Hello,

I am trying to evaluate Nagios Log Server, but I run into setup and configuration problems.

I followed "How To Create A Nagios Log Server Instance In The Amazon EC2 Cloud Environment" instructions and used EU-West version of the image. When I tried to SSH in the first time, I got the message:

Code: Select all

Please login as the user "cloud-user" rather than the user "root".
I was able to log in as cloud-user instead. I am also able to log in to Nagios Log Server web console.

The first time I needed root access when I wanted to fix system timezone. Right now, I need root access to install tcpdump to follow debugging instructions, otherwise I can not proceed with the evaluation.

How can I gain root access?

Thanks in advance.

Re: How to gain root access to the NLS AWS EC2 AMI?

Posted: Thu Mar 31, 2016 9:33 am
by hsmith
Does the command sudo su work?

Re: How to gain root access to the NLS AWS EC2 AMI?

Posted: Thu Mar 31, 2016 9:34 am
by eloyd
Have you tried

Code: Select all

sudo -i
or

Code: Select all

sudo su
?

Edit: Rats. Beaten by 60 seconds. :-)

Re: How to gain root access to the NLS AWS EC2 AMI?

Posted: Thu Mar 31, 2016 10:19 am
by Dante
I have tried sudo su before.

Code: Select all

sudo -i
[sudo] password for cloud-user: 
Sorry, try again.
[sudo] password for cloud-user: 
Sorry, try again.
[sudo] password for cloud-user: 
Sorry, try again.
sudo: 3 incorrect password attempts
I have tried a bunch of default passwords that know of. What's the correct password?

Re: How to gain root access to the NLS AWS EC2 AMI?

Posted: Thu Mar 31, 2016 10:23 am
by eloyd
There is no root password on AWS instances. Have you tried following the part in the directions where it says:
When connecting you must use the username ec2-user NOT root. This user has full sudo access.

Re: How to gain root access to the NLS AWS EC2 AMI?

Posted: Thu Mar 31, 2016 10:44 am
by Dante
I did not try to log in as ec2-user because I got the following output.

Code: Select all

ssh -i key.pem -v XX.XX.XX.XX
.....
debug1: Remote: Forced command: echo 'Please login as the user "cloud-user" rather than the user "root".';echo;sleep 10
.....
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
Logging in as cloud-user worked. This has lead me to think that cloud-user is the updated name of ec2-user.

Logging in and gaining root access as ec2-user worked.
Thanks for the quick response!

Re: How to gain root access to the NLS AWS EC2 AMI?

Posted: Thu Mar 31, 2016 11:25 am
by eloyd
The underlying base AWS EC2 instance always has an ec2-user for RHEL derived OS installs. Glad I could help.

Re: How to gain root access to the NLS AWS EC2 AMI?

Posted: Thu Mar 31, 2016 12:32 pm
by rkennedy
Thanks @eloyd!

Are we good to mark this thread as resolved, and close it out?

Re: How to gain root access to the NLS AWS EC2 AMI?

Posted: Mon Apr 04, 2016 7:52 am
by Dante
My issue was resolved. Thanks.