So i have OpenSSH in windows 7 at a university and i am basicly having this problem:

When i first use SSH it is trying to create the known_hosts file on my university network drive H:

enter image description here

But this is not what i want. How can i define a knew location for the known_hosts file and get it to generate there?


Set the environment variable HOME to a directory in which you want the .ssh directory to be stored.

  • How do i set and check HOME? – Fantastic Mr Fox Aug 12 '12 at 22:28
  • and are you sure the environment variable is home because %HOME% is not recognised. – Fantastic Mr Fox Aug 12 '12 at 22:55
  • See itechtalk.com/thread3595.html. What do you mean by "%HOME% is not recognized"? – Fran Aug 13 '12 at 1:48
  • i cant cd to %HOME% it says that it is not a recognised path. – Fantastic Mr Fox Aug 13 '12 at 2:08
  • Does echo %HOME% show you the value of the variable? If so, the variable is set. Get that working, and the rest should work too. – Fran Aug 13 '12 at 13:59

use variable name as HOME and variable value as %userprofile% to set the home dir in windows.By default your .ssh folder should be there.

To view or change environment variables:
 1.Right-click My Computer, and then click Properties.
 2. Click the Advanced tab.
 3. Click Environment variables.
 4. Click one the following options, for either a user or a system variable:
   o    Click New to add a new variable name and value.
   o    Click an existing variable, and then click Edit to change its name orvalue.
   o    Click an existing variable, and then click Delete to remove it.

Complete article to set up environment variable

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.