Steps to identify the EC2 instance AWS account information

We have lot of accounts for each application in AWS  and few we will have rights and others restricted . Few cases like we have access to the SSH of the EC2 instance but not aware of  which AWS account the instance belongs.

Easy way to identify the account details , follow the below steps.

  1. curl http://169.254.169.254/latest/meta-data/mac

We will get the MAC output( example ) 1a:2b:3c:4d:5:6f 

2. http://169.254.169.254/latest/meta-data/network/interfaces/macs/‘mac’/owner-id

http://169.254.169.254/latest/metadata/network/interfaces/macs/1a:2b:3c:4d:5:6f /owner-id

We will get the corresponding AWS account number as the output.

Advertisements
This entry was posted in AWS and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s