DEV Community

eddiejpot
eddiejpot

Posted on

Where to store SSH key (For Windows) πŸ”‘

Prerequisites


Step 1: Understand how to access Linux On Windows

Method 1: Using the file explorer

  1. Type \\wsl$\ into the file explorer. This will direct you to the location of the Ubuntu folder.
    Alt Text

  2. Navigate to your linux folder. Ubuntu -> Home -> <LINUX USERNAME>
    Alt Text

Method 2: Using the WSL terminal

# This command navigates to the linux folder

cd ~/
Enter fullscreen mode Exit fullscreen mode
# This command lists the files that are in the linux folder

ls -a ~
Enter fullscreen mode Exit fullscreen mode

Step 2: Create .ssh folder (this is where we'll put the ssh key)

Notes: If this is your first time accessing this folder, you probably do not have a folder for ssh files and will have to create your own.

Method 1: Using the file explorer

  1. Create a folder in your linux folder and name it ".ssh" Alt Text
  2. Done! Now you can put the key pairs in this folder

Method 2: Using the WSL terminal

# 1. Check if you have a .ssh folder. If you don't have an ssh folder it'll return "No such file or directory"

ls ~/.ssh
Enter fullscreen mode Exit fullscreen mode
# 2. Create a folder called .ssh 

mkdir ~/.ssh
Enter fullscreen mode Exit fullscreen mode
# 3. Copy any key pairs you need into this folder
# Note: You have to be in the same directory as the file you want to copy
# syntax: cp <FILENAME> ~/.ssh

cp my-aws-ec2-keypair.pem ~/.ssh
Enter fullscreen mode Exit fullscreen mode

Top comments (0)