Why are files created by Puttygen hidden in Windows 7 Explorer?

18

5

In Windows 7 Home Premium, after saving a private key in PuTTY Key Generator (aka. Puttygen) at the C drive root it is not visible in Explorer.

How to reproduce:

  1. Start Puttygen.
  2. Generate a key.
  3. Click "Save private key" (this also works for "Save public key", but I only tested the original case with that).
  4. Navigate to C:.
  5. Enter a name, for example id_rsa, to save the file as C:\id_rsa.ppk.
  6. Start Explorer.
  7. Navigate to C:.

Result: No id_rsa.ppk is visible.

To prove that the file exists:

  1. Go back to Puttygen.
  2. Click the "Save private key" button again.
  3. Navigate to C:.

In this window, you can interact with the file. I checked the file properties from there:

  • It's not hidden.
  • "Full control" is checked for my user.
  • "Opens with" strangely says "Windows Shell Common Dll".

Additional information:

  • I installed Windows yesterday, so it's not some Sony-infested monstrosity.
  • It's got all the latest security updates and .NET 4.0.
  • I do have TortoiseGit and 7zip integration installed, so it is conceivable that they have something to do with this (although .ppk files should not be related to either of them).

Things which did make the file show up in Explorer:

  • Saved the file in another directory, then copied/moved it (both worked) with Explorer to C:\. I did get a "Destination Folder Access Denied" request where I had to click "Continue" first.
  • Saved the file in another directory and navigated there instead.
  • Saved the file on the root of another disk (D: in this case) and navigated there.

Things which failed to make the file show up in Explorer (hitting F5 to refresh in the Explorer window after each action):

  • Renamed the file to foo.ppk.
  • Saved a second copy under a different name.
  • Turned on "Show hidden files, folders and drives".
  • Turned off "Hide protected operating system files".
  • Saved the file in another directory, then copied it to C:\ in the Puttygen save dialog. I was not asked to give permission to save the file, like in Explorer.

My naive assumption is that Explorer has some built-in special case for "restricted" (not actually restricted, since Puttygen trivially ignores it) directories, only updating the file list through the "Destination Folder Access Denied" dialog. What is the actual cause?

l0b0

Posted 2013-08-08T13:13:42.773

Reputation: 6 306

Answers

24

In Vista and newer versions of Windows, an unprivileged process is not allowed to save to folders where "Users" doesn't have write access (even if you are a local admin and the Administrators group does have access). So when an unprivileged program tries to write a file there it actually gets saved in %localappdata%\VirtualStore.

Chris S

Posted 2013-08-08T13:13:42.773

Reputation: 5 907

2Thanks, this was it. Good ol windows, constantly taking away your control over your own OS. – Amalgovinus – 2014-07-09T18:42:48.630

@Amalgovinus - Control was not taken away just the work flow was changed, for security reasons, an elevated process works exactly like it always has. Vista just changed how a process is elevated, a user has to specifically request it, instead of a process automatically running with the same permissions as the user. – Ramhound – 2016-01-04T20:46:22.583

This also worked for Windows 10 x64 – user38537 – 2017-01-28T03:46:28.497

0

Well I have seen the same behavior, and the files are indeed in VirtualStore, but what I thought was interesting is if I load the bash shell (I have cygwin installed), it shows the files as in Program Files\putty just like I thought they should be rather than strangely not visible like the windows cmd shell says. So if you have cygwin, you can look at your key files that way rather than traipsing all over the filesystem.

Patrick Taylor

Posted 2013-08-08T13:13:42.773

Reputation: 11

Your answer doesn't seem real clear to me for some reason! – Pimp Juice IT – 2016-02-12T22:42:21.923