Search code examples
sshopenssh

Windows 10 SSH folder and known_hosts file is missing


On windows it is usually stored in the %USERPROFILE%\ssh or %USERPROFILE%.ssh folders.

However I do not see the ssh folders when going to %USERPROFILE%. Is it possible to create the ssh folder and the known_hosts file myself?


Solution

  • Yes, this is expected.

    You can in a CMD do:

    cd "%USERPROFILE%"
    mkdir .ssh
    

    From there, assuming you have ssh-keygen in your PATH (which is included in Git For Windows for example), you can type:

    ssh-keygen -t rsa -P ""
    

    That will generate a key in the default path ~/.ssh(/id_rsa[.pub]), with ~/.ssh being translated in %USERPROFILE%\.ssh