Import Application from GitHub using SSH deploy key
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2020 08:20 AM
Hi,
I am trying import application from GitHub repository using SSH key. The public key is uploaded to GitHub as deploy key with read/write access. The private key is imported to ServiceNow as SSH Private Key credential. I am getting the error "Repository authentication failed, check credentials. Make sure the user has both read and write access" when importing the application. What is the proper information required? This are what I used:
Network protocol: SSH
URL: git@github.com:my_username/devtraining-needit-paris.git
Branch: master
MID Server Name: <blank>
Credential: my_ssh_private_key_credential
Thanks
- Labels:
-
Integrations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2022 06:36 AM
Hi Tim,
Can you add a section for the Github deploy keys? It is a bit different than just the SSH API Key-pair. Deploy keys are way more secure because it only gives access to the specific repo, whereas SSH keys give access to all repos.
-Dorian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2023 06:13 AM
Hi guys, I was running into the same issue and here is how you fix it.
Note: You have to generate the SSH Key using one of the algorithms know to ServiceNow (ed25519 is currently not one of them).
Those are can be seen here:
https://docs.servicenow.com/bundle/rome-servicenow-platform/page/product/mid-server/reference/mid-ss...
I'd suggest you use deployment keys for GitHub Enterprise Server, as fine granular deployment keys are not yet available on this platform (only for GitHub Cloud Platforms):
1.) ssh-keygen -t ecdsa-sha2-nistp521
Filename: deploykey
Passphrase: mypassphrase
2.) pbcopy < deploykey.pub (copies the content of the generated public key into your clipboard)
3.) Open the GitHub Repository > Settings > Deploy Keys
4.) Paste the public key in the key field and choose a title (e.g. ServiceNow SSH Key)
5.) Copy the private key to your clipboard: pbcopy < deploykey
6.) Add a SSH Private Key to the ServiceNow Instance. In the filter navigator: ssh_private_key_credentials.do
You have just enter the name, SSH passphrase and SSH private key