How to Generate SSH Keys | InMotion Hosting (2024)

by InMotion Hosting Contributor

4 Minutes, 16 Seconds to Read

Secure Shell (SSH) access grants you command-line interface (CLI) access to your web server. One of the major advantages of SSH is a secure, remote connection to your server. The SSH program uses a password to connect, but it is more secure to use SSH keys, or SSH key pairs. This is a type of cryptographic challenge-response authentication to ensure integrity with SSH connections. SSH is included with all hosting plans but for “sudo” or root access VPS managed Hosting is required.

This guide is for using SSH with root access on a VPS or dedicated server. If you are trying to use SSH for a shared or reseller hosting account, follow our guide titled How to SSH into your Shared/Reseller Server (or for macOS).

In this article, we’ll outline the process for creating an SSH key pair for various Operating Systems (OSs):

  • Windows with PowerShell
  • Windows with PuTTY
  • Unix and macOS Terminal

Experience full control over your server environment and deploy the best operating and management systems that fit your needs with our reliable Cloud VPS Hosting!

Generate SSH Keys in Windows with PowerShell

Windows 10 provides OpenSSH natively, which may be accessed from the Command Prompt or PowerShell.

  1. Open the Start menu and type PowerShell.
  2. Select PowerShell and click the Run as Administrator option.
  3. Generate an SSH key pair:
    ssh-keygen
  4. Press Enter again when you see a prompt to “Enter file in which to save the key”.
  5. When prompted, type a secure passphrase, and press Enter.
  6. When prompted, type the secure passphrase again to confirm, and press Enter.
  7. You should see something similar to the following.
    Enter file in which to save the key (C:\Users\/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in C:\Users\/.ssh/id_rsa. Your public key has been saved in C:\Users\/.ssh/id_rsa.pub. The key fingerprint is: SHA256:m9eb6SIE28EmCLLR6Uj1A/UdFy6iZE48AEsJnMiu0Jc @ The key's randomart image is: +---[RSA 2048]----+ |*+==.. . o. | |=*= = . . + | |oO . @ + o . | |+.o E * = . | |o . o *S. | |. . oo . | | .o . . | | ... + | | . o= | +----[SHA256]-----+ 
  8. (Optional) Ensure your ~/.ssh permissions are correct:
    cd .ssh

    icacls id_rsa.pub /inheritance:r

    In the command below, replace username with your Windows username.


    icacls id_rsa.pub /grant:r username:"(R)"

Generate SSH Keys in Windows with PuTTY

PuTTY is a popular 3rd party application for configuring SSH access. If you prefer to use this graphical tool instead of the terminal, you can follow these steps.

These steps only work for PuTTY on Windows. Unix PuTTY users will need to use the puttygen CLI tool or the OpenSSH option below.

  1. Open the PuTTYgen application.
  2. For ‘Type of key to generate‘, select RSA.
    How to Generate SSH Keys | InMotion Hosting (1)
  3. For ‘Number of bits in a generated key‘, select 4096.
    How to Generate SSH Keys | InMotion Hosting (2)
  4. Click Generate.
    How to Generate SSH Keys | InMotion Hosting (3)
  5. Move your mouse pointer around in the Key section until the progress bar is full.
    How to Generate SSH Keys | InMotion Hosting (4)
  6. Optional: Type a comment into the Key comment section to help with identifying this SSH key pair.
  7. Optional but recommended: Type a secure passphrase into the Key passphrase field, and again into the Confirm passphrase field.
    How to Generate SSH Keys | InMotion Hosting (5)
  8. Finally, click the Save public key, and also the Save private key buttons.
    How to Generate SSH Keys | InMotion Hosting (6)

    Be sure to save both keys in your user’s .ssh directory inside their home directory. For instance:

    C:\Users\userna5\.ssh\id_rsa.pubC:\Users\userna5\.ssh\id_rsa.ppk

    The public key can be copied from the Key field to add an SSH Key for Cloud Server Hosting.

    Generate SSH Keys in Unix or macOS Terminal

    This section applies to OpenSSH users on *nix-based OSs including Linux, macOS, BSD.

    1. Open a Terminal from your application list.
    2. In your terminal, type the following command:
      ssh-keygen -t rsa -b 4096
    3. Press Enter again when you see a prompt to “Enter file in which to save the key”.
    4. When prompted, type a secure passphrase, and press Enter.
    5. When prompted, type the secure passphrase again to confirm, and press Enter.
      You should see the following successful message containing the details that pertain to your key that was generated:
      userna5@localhost ~ $ ssh-keygen -t rsa -b 4096Generating public/private rsa key pair.Enter file in which to save the key (/home/userna5/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/userna5/.ssh/id_rsa. Your public key has been saved in /home/userna5/.ssh/id_rsa.pub. The key fingerprint is: SHA256:PRxLu/LU6ZfFDve1sTIR0nK86NJVYRxRONCz0N5oy7U userna5@localhost The key's randomart image is: +---[RSA 4096]----+ | .+.+=| | . *+ | | o oo.*.| | + * ==.o| | S * =o++.| | = =+E=| | . = + .**| | = + oooo| | o ..o | +----[SHA256]-----+
    6. (Optional) Ensure your ~/.ssh permissions are correct. To ensure your ~/.ssh folder has the correct permissions:
      chmod 0700 ~/.ssh
    7. Then, correct the permissions of the files within the ~/.ssh folder:
      chmod 0600 ~/.ssh/*

    Your public key has been saved in /home/userna5/.ssh/id_rsa.pub“. The text in this file is the public key that you will need to add an SSH Key to your Linux Cloud Server. Then, you’re ready to SSH into your Linux server.

    If you are unable to locate this file simply type in cd ~/.ssh to navigate to your .ssh folder then use the ls -alh command to list all files in that directory.

    How to Generate SSH Keys | InMotion Hosting (7)

    InMotion Hosting ContributorContent Writer

    InMotion Hosting contributors are highly knowledgeable individuals who create relevant content on new trends and troubleshooting techniques to help you achieve your online goals!

    More Articles by InMotion Hosting

    Related Articles

    Was this article helpful? Join the conversation!

How to Generate SSH Keys | InMotion Hosting (2024)
Top Articles
FSSAI bans artificial ripening of fruits with calcium carbide due to health concerns
How did Dogecoin become Elon Musk’s favourite cryptocurrency?
123Movies Encanto
Cold Air Intake - High-flow, Roto-mold Tube - TOYOTA TACOMA V6-4.0
Pangphip Application
Nwi Police Blotter
Trade Chart Dave Richard
Corpse Bride Soap2Day
zopiclon | Apotheek.nl
What is the difference between a T-bill and a T note?
Burn Ban Map Oklahoma
Ahrefs Koopje
Outlet For The Thames Crossword
Shiftselect Carolinas
Directions To Cvs Pharmacy
R&S Auto Lockridge Iowa
Inbanithi Age
Low Tide In Twilight Ch 52
Dmv In Anoka
Cal State Fullerton Titan Online
Usa Massage Reviews
Encore Atlanta Cheer Competition
Sams Gas Price Sanford Fl
Wolfwalkers 123Movies
Miller Plonka Obituaries
How To Improve Your Pilates C-Curve
Revelry Room Seattle
Rogold Extension
Wake County Court Records | NorthCarolinaCourtRecords.us
Southern Democrat vs. MAGA Republican: Why NC governor race is a defining contest for 2024
Beaver Saddle Ark
How does paysafecard work? The only guide you need
Lucky Larry's Latina's
How to Watch the X Trilogy Starring Mia Goth in Chronological Order
Koninklijk Theater Tuschinski
Housing Intranet Unt
Craigs List Palm Springs
10 Rarest and Most Valuable Milk Glass Pieces: Value Guide
RECAP: Resilient Football rallies to claim rollercoaster 24-21 victory over Clarion - Shippensburg University Athletics
No Boundaries Pants For Men
Gamestop Store Manager Pay
Wgu Admissions Login
Bmp 202 Blue Round Pill
Star Sessions Snapcamz
Used Sawmill For Sale - Craigslist Near Tennessee
Hampton Inn Corbin Ky Bed Bugs
Otter Bustr
Rise Meadville Reviews
Minecraft Enchantment Calculator - calculattor.com
Metra Union Pacific West Schedule
Latest Posts
Article information

Author: Pres. Lawanda Wiegand

Last Updated:

Views: 6065

Rating: 4 / 5 (71 voted)

Reviews: 94% of readers found this page helpful

Author information

Name: Pres. Lawanda Wiegand

Birthday: 1993-01-10

Address: Suite 391 6963 Ullrich Shore, Bellefort, WI 01350-7893

Phone: +6806610432415

Job: Dynamic Manufacturing Assistant

Hobby: amateur radio, Taekwondo, Wood carving, Parkour, Skateboarding, Running, Rafting

Introduction: My name is Pres. Lawanda Wiegand, I am a inquisitive, helpful, glamorous, cheerful, open, clever, innocent person who loves writing and wants to share my knowledge and understanding with you.