>_
EngineeringNotes
Module 03

SSH & Security

How to safely enter a computer that is thousands of miles away.

01

What is SSH?

SSH (Secure Shell) is a cryptographic network protocol for operating network services securely over an unsecured network.

In simple terms: It creates a secure tunnel between your laptop and the server.

Terminalbash
ssh user@192.168.1.50
02

The Key Concept (Pun Intended)

Passwords are weak. Pros use Key Pairs.

Public Key (Lock)

You give this to the server. Anyone can see it. It acts like a logic lock on the server's door.

id_rsa.pub

Private Key (Key)

NEVER SHARE THIS. This stays on your laptop. It is the only thing that can open the lock.

id_rsa / server.pem
03

The '0644 are too open' Error

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0644 for 'server.pem' are too open.

SSH is paranoid. If your private key file is readable by other users on your computer (Permission 0644), it refuses to use it.

The Fix:

Make it readable only by YOUbash
chmod 400 server.pem

400 = User (Read), Group (None), Others (None).

04

Connecting to AWS/Server

Once your key permissions are fixed, you connect using the -i (identity) flag.

Terminalbash
ssh -i server.pem ubuntu@ip-address