How to connect Ec2 - Mac:
- Loign/create an account with AWS management console.
- Create an instance with required configuration based your needs and download .pem file? Any queries reach me out via blog and comment.
- Select instance [checkbox] then choose instance state and start your instance.Wait a while once it is up and running open your terminal by [command+Spacebar] then enter terminal.
- By default it will open user home directory, there you must place the .pem file and then change the access using the below cmd.
chmod 400 myec2key.pem then hit enter
- Goto AWS console, select your instance & click on connect tab on top of so you will get four options. EC2 instance Connect, Session Manager, SSH client, EC2 Serial Console.
- Select SSH Client and copy the example code cmd displayed on your screen and paste it your terminal home page.
ssh -i "myawskeyjenkins.pem" ubuntu@ec2-43-205-135-130.ap-south-1.compute.amazonaws.com or
ssh -i myawskeyjenkins.pem ec2-user@43.205.135.130 [pulbic IPV4 address].
That’s it.