Home directory of the LocalSystem account in Windows Server 2012
Quite a few applications that I had encountered throughout my career provide the option to look for custom configurations inside the home directory of user accounts that had started them. One such example is the Git command, which looks for the private key to communicate with a GitHub repository inside a
.ssh directory located inside the home directory of the user that runs it.
This post documents the home directory of the LocalSystem account in my Windows Server 2012.
Getting my Windows Jenkins Slave to use Git command to checkout latest changes
I had a dedicated Windows Jenkins Slave running on my Windows Server 2012 which performs functional tests on the application that I am developing. Before performing the functional tests, the Windows Jenkins Slave needs to use Git to checkout the latest changes from the GitHub repository to the directory where my test server loads from.
As the Windows Jenkins Slave is only used for running the functional tests, the fastest way to get it to checkout the latest changes via ssh was to put the private key settings in a
.ssh directory inside the home directory of the user account running my Windows Jenkins Slave. For example, when I login as the user Foo to checkout the latest code from my GitHub repository, the Git command will look inside
C:\Users\Foo\.ssh for a private key to communicate with my GitHub repository.
However, because my Windows Jenkins Slave is started by the Windows Service manager, I will need to put the .ssh folder inside the home directory of the LocalSystem account.
Where is the home directory of the LocalSystem account in Windows Server 2012?
After some googling, I found out that the home directory of the LocalSystem account is
C:\Windows\System32\config\systemprofile. With that, I copied the
.ssh directory into
C:\Windows\System32\config\systemprofile and my Windows Jenkins Slave was able to use the Git command to checkout the latest changes from the GitHub repository.
This verified that the home directory of the LocalSystem account in my Windows Server 2012 is indeed