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 inC:\\Windows\\SysWOW64\\config\\systemprofile\\.ssh
. So I copied everything inC:\\Users\\Administrator\\.ssh
to that folder and it worked perfectly.
Basically have your keys in the C:\\Windows\\SysWOW64\\config\\systemprofile\\.ssh
folder.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.