How can I set up a github Machine User on Coldfusion (on Windows)?
I am writing a Coldfusion web app (for internal use) that allows our project managers to begin the deployment of a new project. A key component of that app requires it to clone a repository on github. I am stuck on communicating the credentials when I execute the git clone.
I think the canonical solution to this would be to set up a Machine User with a set of ssh keys, but I don't know how to associate the key with the server in a way that it would be available to the application.
I can have whatever access to the server I need in order to accomplish this.
I don't know if it's relevant, but here is the example code in question:
cfexecute( variable = "output", name = "c:\progra~2\git\bin\git.exe", arguments = "clone ssh://[github path] d:\inetpub\wwwroot\[file path]", timeout = 240 );
I don't know how to associate the key with the server in a way that it would be available to the application.
You need to see which user is going to run the application (I assume that your webserver has a particular user), and then as that user generate a keypair and upload the key to GitHub.
You can also try this answer, which basically states:
I faced the same problem today and used Process Monitor to see what was going on and found that for some reasons sh.exe looked for the keys in C:\Windows\SysWOW64\config\systemprofile\.ssh. So I copied everything in C:\Users\Administrator\.ssh to that folder and it worked perfectly.
Basically have your keys in the C:\Windows\SysWOW64\config\systemprofile\.ssh folder.