In this article, We have to learn, how to get instance-id, instance-type, Public key, and Security groups name on an AWS server without AWS console login credentials.
- AWS ubuntu Instance
- Sudo access (or) root access for the instance
Login to the Instance with Sudo or root access
Update and install curl on the instance/server with the below command.
$ sudo apt update $ sudo apt install curl
To view the AWS instance id on Server/instance. Run the below command.
$ curl http://169.254.169.254/latest/meta-data/instance-id
To view the AWS instance type on server/instance.
$ curl http://169.254.169.254/latest/meta-data/instance-type
To view the AWS public keys which are using instance.
$ curl http://169.254.169.254/latest/meta-data/public-keys
To view the AWS security group name which is using instance.
$ curl http://169.254.169.254/latest/meta-data/security-groups
169.254.169.254 IP is unique for all ubuntu servers.