2

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
        );
Jason Francis
  • 1,104
  • 2
  • 14
  • 25

1 Answers1

1

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.

Community
  • 1
  • 1
Serban Constantin
  • 3,316
  • 1
  • 18
  • 20
  • Four our setup of coldfusion, we had to copy the keys into c:\windows\system32\config\systemprofile. Otherwise, it worked great. Thanks! – Jason Francis Apr 11 '16 at 18:28