SSH let me copy my .pem key and connect instantly, while PuTTY forced me to convert to .ppk every time SSH saved time, reduced friction, and scaled securely.
This project matters because it teaches secure, real‑world cloud skills: launching EC2, using SSH with .pem keys, avoiding PuTTY conversions, and hosting a webpage. It builds automation habits, scales easily, and mirrors workflows businesses rely on daily.
Step by Step on how to SSH into Ubuntu EC2 from Gitbash.
- Launch an EC2 Instance
- Log in to the AWS Management Console.
Search for EC2 and open the EC2 dashboard.
Click Launch Instance.
- Fill in the details:
Name: e.g., elmaurserver.
- AMI (Amazon Machine Image): Choose Ubuntu Server 22.04 LTS (or Amazon Linux if you prefer).
I choose Ubuntu.
- Instance type: Start with t2.micro (free tier eligible).
- Key pair: Create a new key pair → name it dehnikeypair → download the .pem file.
- Network settings: Allow SSH (port 22) from your IP. Optionally allow HTTP (port 80) if you plan to run a web server.
Click Launch Instance.
Locate Your Public IP.
- In the EC2 dashboard, select your instance.
- Under Details, copy the Public IPv4 address (example: 18.132.3.224).
Open Git Bash.
- Fix permissions:
Connect via SSH.
- For Ubuntu:
- Update Your Server
Common Mistakes I Hit and Fixes.
No such file or directory on chmod → Use Git Bash path (/c/...), not Windows path (C:...).
Tried to run the .pem file → Never execute the key. Only reference it with -i in ssh.
Permission denied (publickey) → Use the right username (ubuntu for Ubuntu AMI).
IP keeps changing → Use an Elastic Ip.
Conclusion.
Why I Preferred SSH Over PuTTY
PuTTY is popular on Windows, but here’s why I preferred SSH in Git Bash:
No extra conversions — .pem works directly; PuTTY requires .ppk.
Fits naturally into my Git workflow.
Scriptable and automation-friendly.
Industry standard across Linux, macOS, and Windows.
Consistent experience across platforms.
Security: Strong key‑based authentication, no passwords.
Automation: SSH integrates with CI/CD pipelines and config management tools.
Collaboration: Developers use SSH keys with GitHub/GitLab for secure code pushes.
Resilience: Elastic IPs + SSH allow fast recovery during outages.
Scalability: Manage fleets of servers with scripts, not GUIs.









Top comments (0)