title: OpenSSH on Windows - "XXX Could not save your public key in __PROGRAMDATA__
body: <p>I am trying to install OpenSSH on a Windows Server (2012 R2 standard) and I have been following the instructions at this locataion: <a href="https://www.server-world.info/en/note?os=Windows_Server_2012&amp;p=openssh" rel="noreferrer">https://www.server-world.info/en/note?os=Windows_Server_2012&amp;p=openssh</a> </p>
  
  <p>I ran Powershell as Administrator and all seems to install correctly up to the part where I try to generate the SSH host-key by running the command <code>.\ssh-keygen.exe -A</code> (step 7 of the instructions).
  After running this it returns an error saying:</p>
  
  <blockquote>
    <p>RSA Could not save your public key in __PROGRAMDATA__\\ssh/ssh_host_rsa_key.9uX3wf3apv: No Such file of directory"</p>
  </blockquote>
  
  <p>The same error also displays for DSA, ECDSA and ED25519.</p>
  
  <p><img src="https://i.stack.imgur.com/RnsRp.png" alt="Screenshot of errors"></p>
  
  <p>If anyone can tell me where I am going wrong here it would be appreciated. I've searched the web and not found any other references to this.</p>