Import Application from GitHub using SSH deploy key

echong
Kilo Explorer

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

 

6 REPLIES 6

thomas_wright1
Giga Contributor

Were you ever able to get this working?  Trying to set up source control with our enterprise GitHub instance.  

chris_thompson
Tera Contributor

Please refer to https://docs.servicenow.com/bundle/paris-application-development/page/build/applications/task/t_Link...

I had the same issue and had to recreate my SSH private/public keys by creating them with the following:

ssh-keygen -t rsa -m PEM -b 4096 -C “email@address”

Hope this helps.

Chris

DorianK
Tera Expert

Were you able to resolve this? I got this working in Rome, but now I am struggling getting it working in San Diego. I know that Github is trying to make rsa deprecated, but I don't believe ServiceNow supports the eid format yet.I also tried attaching the ssh key directly to my account and I still got the same error as above.

I ended up having to use basic auth with a basic token. Since it is on a PDI, I haven't submitted a HiWave ticket about it.

 

@Andrew Barnes - AJB - You know if there are anything in the Studio team queue about this?

Tim Woodruff
Mega Guru

I recently wrote a 'ServiceNow Pro Tips' article on this, which teaches you:

  1. How to change which GitHub / repository your ServiceNow application in Studio
  2. How to update your GitHub repo credentials in ServiceNow
  3. How to generate ECDSA SSH keys and link your ServiceNow application with GitHub using SSH (including the new GitHub rule against using insecure RSA keys) - since GitHub no longer supports basic auth or RSA SSH keys
  4. How to generate/link your SSH API key-pair with GitHub and ServiceNow, using your public/private keys

You can see the full article with detailed step-by-step instructions, here: https://snprotips.com/blog/2022/3/4/how-to-change-servicenow-applications-repositoryurl