Aapka command:
ssh -i "my_key_usethis.pem" ubuntu@ec2-13-201-40-146.ap-south-1.compute.amazonaws.com
🔎 Iska meaning
| Part | Meaning |
|---|---|
ssh |
Secure Shell – remote server connect karne ke liye |
-i my_key_usethis.pem |
Private key file (AWS key pair) |
ubuntu |
EC2 instance ka username |
ec2-13-201-40-146.ap-south-1.compute.amazonaws.com |
EC2 public DNS |
✅ Windows (Git Bash / MINGW) me run karne ke steps
1️⃣ Key file folder me jao
Example:
cd /d/AWS_PAIR_KEY
2️⃣ Permission set karo
chmod 400 my_key_usethis.pem
3️⃣ SSH connect karo
ssh -i my_key_usethis.pem ubuntu@ec2-13-201-40-146.ap-south-1.compute.amazonaws.com
⚠️ Common Errors
1️⃣ Permission denied
Solution:
chmod 400 my_key_usethis.pem
2️⃣ Connection timed out
Check:
- EC2 running hai
- Security group me port 22 open hai
Inbound rule:
| Type | Protocol | Port | Source |
|---|---|---|---|
| SSH | TCP | 22 | 0.0.0.0/0 |
💡 DevOps Interview Tip
Interview me puchte hain:
How do you connect to an EC2 instance?
Answer:
ssh -i keypair.pem ubuntu@public-ip
Steps:
1️⃣ EC2 launch
2️⃣ Key pair download
3️⃣ Port 22 open in security group
4️⃣ SSH using private key
Top comments (0)