Amazon EC2
Tags
- They are used to label resources which can be further used to query and filter
- Follow atleast the following tags for every resourcs
environment: dev
project: learning
purpose: learning
Credentials
- Username in AWS is fixed and is from AMI.
- AWS gives an option to set key pair for EC2 instance
-
Credential types:
- Username and Password
- Username and Key
-
Key Pair is collection of
- Private key
- Public Key
- AWS has two options
- import your key
- create a key pair
- Linux:
- We can use the private key directly
-
Windows:
- We need to generate password from private key
-
Generating a key pair from AWS
-
Lets create a keypair called as november
-
Importing existing key pair to AWS
- Generate key in your local machine if you dont have it already
ssh-keygen
- in your homdir
- private key
~/.ssh/id_rsa
- public key
~/.ssh/id_rsa.pub
- private key
- Generate key in your local machine if you dont have it already
Create a redhat linux with imported key pair
- Screenshots
Create a Windows Server with created key pair
- Screenshots
- Execute
mstsc -v <publcip>
- Get credentials
RDP
- RDP (Remote Desktop Protocol)
- PORT: 3389
- client: Remote desktop
- use the following command
mstsc -v <ipaddress>
SSH Commands
- SSH (Secure Shell)
- PORT: 22
- SSH command with key
ssh -i <path to private key> <username>@<ipaddress>
- SSH command searches for key in default location
~/.ssh
- SSH Command with password
ssh <username>@<ipaddress>