Chapter 03 · Remote access
Connect over SSH
Use the key pair from your own computer to open a terminal session on Ubuntu. Choose the instructions for your operating system.
macOS or Linux
Open Terminal, move into the folder containing your key, restrict its permissions, then connect.
Terminal
chmod 400 my-key.pem
ssh -i my-key.pem ubuntu@YOUR_PUBLIC_IPWindows PowerShell
Open PowerShell in the folder containing your key. Windows uses icacls instead of chmod to restrict access.
PowerShell
icacls .\my-key.pem /inheritance:r /grant:r "$($env:USERNAME):(R)"
ssh -i .\my-key.pem ubuntu@YOUR_PUBLIC_IPReplace both placeholders: use the actual key filename and the instance's public IPv4 address.