Docs

⌘K
  1. Home
  2. Docs
  3. Server
  4. SSH Keys

SSH Keys

SSH keys are cryptographic keys used to authenticate users to servers, offering a more secure method than traditional passwords. By leveraging both a public and a private key, SSH keys ensure secure, encrypted communication between the server and the client.

Table of Contents

  1. Public Key vs. Private Key
  2. Advantages of Using SSH Keys Over Passwords
  3. Adding SSH Keys in FlyWP
  4. Team SSH Keys in FlyWP
  5. How to Obtain the Public SSH Key
  6. Adding SSH Keys in FlyWP
  7. How to Log in to the Server using SSH
YouTube video

Public Key vs. Private Key

  • Public Key: As the name suggests, this key is public and can be shared. It is placed on the server and used to lock the data that only the private key can unlock.
  • Private Key: This key remains confidential and resides on the client’s machine. It’s used to unlock data encrypted by the public key. Under no circumstances should the private key be shared or exposed.

The combination of the private key and the public key enables secure communication by ensuring that the client holds the matching private key for the public key on the server.

Advantages of Using SSH Keys Over Passwords

  1. Enhanced Security: SSH keys provide a higher level of security compared to password-based logins. It’s virtually impossible for attackers to deduce the private key, even if they have the public key.
  2. Automation: Systems and services can automate tasks like data transfers without needing to input passwords.
  3. Reduced Brute-Force Risk: Since there’s no traditional password, the risk of brute-force attacks is significantly diminished.

How to Obtain the Public SSH Key

Generating and accessing SSH keys varies depending on the operating system. Below are the methods for macOS, Windows, and Linux:

macOS & Linux:

  1. Generate SSH Key: If you haven’t already generated an SSH key, you can do so using the following command in the terminal:

    ssh-keygen -t rsa -b 4096
  2. When prompted, press Enter to accept the default file location and name.
  3. You’ll then be asked to enter a passphrase. You can either enter a passphrase or just press Enter to proceed without one.
  4. Access Public SSH Key: To view your public key, use the cat command followed by the path to your public key. By default, the public key is saved in the ~/.ssh/ directory with the filename id_rsa.pub.

    cat ~/.ssh/id_rsa.pub
  5. Copy the displayed key to use it in FlyWP or any other application.

Windows:

Using PuTTY:

  1. Download and install PuTTY and PuTTYgen from the official website.
  2. Open PuTTYgen.
  3. Click the “Generate” button and follow the on-screen instructions.
  4. Once generated, you’ll see your public key in the “Public key for pasting into OpenSSH authorized_keys file” section.
  5. Copy the public key to use it in FlyWP or any other application.

Using Windows Subsystem for Linux (WSL):

If you have WSL installed, you can follow the macOS & Linux instructions above, as the process is identical.

Remember: Always keep your private key confidential. The public key, on the other hand, can be shared and is used to allow secure access to services that recognize your corresponding private key.

Adding SSH Keys in FlyWP

In the FlyWP dashboard:

  1. Navigate to your server.
  2. Click on “SSH Keys” in the side menu.
  3. Click “Add New Key” and input your public SSH key.
  4. Provide a descriptive name for the key, making it easier to identify later.