Using SSH and creating SSH key pairs¶
Below are instructions for different platforms how to connect with SSH to you instances.
Different Linux distributions use different default user names to connect the first time. Below is a list of which to use for which distribution:
| Distribution | User name to use |
|---|---|
| Ubuntu | ubuntu |
| Rocky Linux | rocky |
| Fedora | fedora |
| Debian | debian |
| Arch Linux | arch |
Windows Using PuTTY¶
- Download and install PuTTY from its official site.
- Open PuTTY and in the Host Name (or IP address) field, enter the server's IP address.
- Set the Port to '22' and the Connection type to SSH.
- Click Open. On the terminal window, log in with your username and password.
- For SSH key authentication, generate a key with PuTTYgen. Copy the public key to the Linux server (into '~/.ssh/authorized_keys').
- In PuTTY, go to Connection > SSH > Auth, click Browse and choose your private key file.
- Connect as before; PuTTY will use the provided key to authenticate.
Mac OS Built-In SSH¶
Open the Terminal. Run this command to connect:
$ ssh username@server_ip
Linux Built-In SSH¶
- Open the Terminal. Connect with the command:
$ ssh username@server_ip
$ sudo apt-get install openssh-client
- Authentication works with password or SSH key, depending on configuration.
Generating an SSH Key (All Platforms)¶
On Linux or Mac OS¶
- Open the Terminal.
- Generate a new key pair with:
$ ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
On Windows¶
- For OpenSSH (Windows 10+): Open Command Prompt and run:
$ ssh-keygen - For PuTTY: Run PuTTYgen, click Generate, follow prompts, and save your public and private keys. Add the public key to
~/.ssh/authorized_keyson the server. - After generation, copy the contents of your '.pub' (public) key onto the remote machine’s '~/.ssh/authorized_keys' file for key-based authentication on all platforms.