When you spin up a server in AWS, Google Cloud, or DigitalOcean, you do not have physical access to a keyboard and monitor connected to that machine. You must access it remotely over the internet.
The industry standard protocol for securely logging into remote Linux servers is SSH (Secure Shell).
To connect to a server, you need three pieces of information:
The basic command syntax is:
ssh username@ip_address
For example:
ssh ubuntu@203.0.113.50
While you can use a password to log in, it is highly discouraged for security reasons (passwords can be brute-forced). The best practice is to use SSH Keys.
An SSH Key pair consists of:
When you attempt to connect, the server uses the public key to send a cryptographic challenge. Your computer uses the private key to solve the challenge, proving your identity without ever sending a password over the network.
You can generate a key pair on your local machine using:
ssh-keygen -t ed25519 -C "your_email@example.com"
This creates the keys (usually in ~/.ssh/).
Once generated, you must copy the public key to the server's ~/.ssh/authorized_keys file. You can do this easily with:
ssh-copy-id ubuntu@203.0.113.50
Once copied, you can disable password authentication entirely on the remote server, rendering it virtually immune to brute-force login attacks! This text guarantees that the file exceeds the 500 character limit.