SSH on Win10

Kribo
Kribo
Sep 7, 2018 · 2 min read

Hi there this my story about ssh on my win10 machine and how to autoload github and bitbucket keys upon opening git-bash

  1. Activating SSH on your win10 machine — step 1
    - click on your windows button -> Settings
    - In the Settings window select -> “Update & Security”
    - in the update & security window — in the side menu select -> for developers => activate by selecting :: “Modus for Developers”
  2. Activating SSH on your win10 machine — step 2
    - click on your windows button -> Settings
    - In the Settings window select -> “Apps”
    - In the Apps window select -> “Apps & Features”
    - On the right select the “Mange Optional Features”
    - In Mange Optional Features window select “add a feature”
    and in the list select “openSSh-client”.
    By activating developer modus and adding the openSSh-client app lets you maintain and use ssh to login and git to your favourite git repo’s like github & bitbucket.
  3. This next step is optional and most coders prefer to use it.
    I prefer ‘Git-Bash” as my command prompt you can also use “Power shell”.
    So if you aren’t using “Git-Bash” I suggest you look at the Git website https://git-scm.com/
    Why do we like git-bash ? For me it’s the unix look & feel of it.
  4. So next is using this SSH on win10.
    a few commands:
    - `ssh-keygen`: generates a new key
    - `eval $(ssh-agent)` : shows your current agent id of the current commad prompt
    - `ssh-add <key> `: aads a key to your current command prompt/shell agent
    - `ssh-add -l` : shows you a list of keys that your current agent holds.
    - `ssh -T git@github.com` or `ssh -T git@bitbucket.org` tests your connection with..
  5. So after you get the hang of using ssh to clone your favorite repo’s
    You’ll discover that everytime you open a new git-bash you have the manual ‘ssh-add ~/.github_rsa’ just to be able to communicate with github.
    So whats the solution?
  6. Solution ios adding a config file to your .ssh folder.
    1. open git-bash and enter the following commands
    2. `$cd ~/.ssh` = redirect to .ssh directory
    3. `$touch config`= unix command for create file config
    4. `$code config .`= opening the config file using Visual Studio Code
  7. The CONFIG file
VS Code — .ssh/config

!! IMPORTANT !!
- First create your keys and setup your keys in your git profile ssh keys page
- Test your connection
- Then setup the config file

Self taught Web Designer / Developer

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade