What is SSH
SSH is a remote administration protocol that allows users to control and modify their servers remotely. SSH uses cryptographic techniques to ensure that all communication to and from the remote server happens in an encrypted manner. It provides a mechanism for authenticating a user, transferring inputs from the client to the host, and relaying the output back to the client. Any Linux or Mac user can SSH into their remote server directly from the terminal window.How does SSH work
Linux or Mac enables you to use SSH clients straight from the terminal window. If you use Windows, you will need to download an SSH client to open SSH connections. The most popular SSH client is PuTTY. The SSH command consists of three distinct parts:{user}
represents the account you want to access.
For example, you may want to access the root user, which is basically synonymous for system administrator with complete rights to modify anything on the system. {host}
refers to the computer you want to access. This can be an IP Address or a domain name (e.g. http://www.xyzdomain.com
).
When you hit enter, you will be prompted to enter the password for the requested account. When you type it in, nothing will appear on the screen, but your password is, in fact being transmitted. Once you’re done typing, hit enter once again. If your password is correct, you will be greeted with a remote terminal window.
You can read more about SSH commands here.
On Windows
You can create SSH keys in many ways. Windows requires an SSH client but doesn’t have a default SSH client on their operating system. The easiest way is to generate SSH Keys using PuttY.1
Download and set up PuTTY
Download PuTTY. The two binaries you will need are:
- PuTTY (the SSH and Telnet client itself)
- PuTTYgen (an RSA and DSA key generation utility)
2
Configure and save keys
Type a passphrase in the Key passphrase field. Type the same passphrase in the Confirm passphrase field. You can use a key without a passphrase, but this is not recommended.Click the Save private key button to save the private key. Important: Never share your private key with anyone.Copy the contents under Public key for pasting into OpenSSH authorized_keys file. Save the contents you just copied somewhere. This is the public key you’re going to use with Latitude.sh and any other services you’d like to connect with SSH. You can save it as a .txt file in order to be able to open it with a text file later.
On Linux & macOS
When you generate the keys, you will usessh-keygen
to store the keys in a safe location so you can bypass the login prompt when connecting to your instances.
1
Generate SSH key pair
Open a Terminal window and enter the following command:
ssh-keygen -t rsa
. This starts the key generation process. When you execute this command, the ssh-keygen
utility prompts you to indicate where to store the key.Press the ENTER key to accept the default location. The ssh-keygen
utility prompts you for a passphrase. Type in a passphrase. You can also hit the ENTER key to accept the default (no passphrase). However, this is not recommended. You will need to enter the passphrase a second time to continue.After you confirm the passphrase, the system generates the key pair.id_rsa
file in the .ssh
directory. Never share your private key with anyone.
Your public key is saved to the id_rsa.pub
file and is the key you upload to your Latitude.sh account. You can save this key to the clipboard by running this:
Adding your SSH Key
If you already have an SSH key pair, you can use it to import it into Latitude.sh.1
Add your SSH key to Latitude.sh
Go to the Latitude.sh dashboard, select a project, and navigate to Compute > SSH keys in the sidebar. Click on Add SSH Key, paste your Public SSH Key, and choose a name for it. The name is only used to help you easily identify the key afterward.It’s recommended you use your e-mail as part of the key name as all users of your team will have access to the imported keys.Click Add and the key will be ready to use when deploying or reinstalling a server.
Project and Team scope
Currently, all SSH keys are team-scoped. When you add an SSH key, it becomes available to all members of your team and can be used in any project when deploying or reinstalling servers. The SSH keys page displays two tabs:- Team: Team-scoped SSH keys are available across all projects within your team.
- Project: Project-scoped SSH keys will be available only within a specific project. This feature is coming soon.