I have found a way to upload an SSH key to my GitHub account with command line, but there is small problem.
I am able to do this with following command:
curl -u "user:pass" --data '{"title":"test-key","key":"ssh-rsa Aaa"}'
https://api.github.com/user/keys
But I am using this in Chef to add my nodes' keys to my GitHub account:
curl -u "user:pass" --data '{"title":"test-key","key":"`cat ~/.ssh/id_rsa.pub`"}' https://api.github.com/user/keys
but it is giving error.
What could be the reason?
cat
command in$()
so that it gets ran rather than literally putting that string of text in as your SSH key. – Bratchley Jul 21 '16 at 08:06