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

This support forum board is for support questions relating to Nagios Log Server, our solution for managing and monitoring critical log data.
Locked
Dante
Posts: 15
Joined: Thu Mar 31, 2016 8:26 am

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

Post 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.
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

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

Post by hsmith »

Does the command sudo su work?
Former Nagios Employee.
me.
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

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

Post by eloyd »

Have you tried

Code: Select all

sudo -i
or

Code: Select all

sudo su
?

Edit: Rats. Beaten by 60 seconds. :-)
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
Dante
Posts: 15
Joined: Thu Mar 31, 2016 8:26 am

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

Post 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?
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

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

Post 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.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
Dante
Posts: 15
Joined: Thu Mar 31, 2016 8:26 am

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

Post 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!
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

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

Post by eloyd »

The underlying base AWS EC2 instance always has an ec2-user for RHEL derived OS installs. Glad I could help.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

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

Post by rkennedy »

Thanks @eloyd!

Are we good to mark this thread as resolved, and close it out?
Former Nagios Employee
Dante
Posts: 15
Joined: Thu Mar 31, 2016 8:26 am

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

Post by Dante »

My issue was resolved. Thanks.
Locked