GIT / GITHUB : Authentication
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Using Personal Access Tokens with GIT and GitHub
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
The Access token is been generated from the GitHub repository.
Tried ping
$ ping github.com
This was giving an error.
So I added couple of name servers in the /etc/resolv.conf
/etc/resolv.conf
nameserver 63.xxx.x.xx
nameserver 63.xxx.x.xx
And now the ping was successful and now the clone worked.
We recommend you use fine-grained personal access tokens to authenticate to the GitHub API.
curl -u USERNAME:TOKEN https://api.github.com/user
curl -u sbalakrishn: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 https://github.com/8x8/auto_pow-dns-rec-SRJ.git
+++Finally this worked : https://docs.github.com/en/rest/overview/other-authentication-methods
Via personal access tokens
curl -u USERNAME:TOKEN https://api.github.com/user
example :
curl -u sbalakrishn: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 https://github.com/8x8/auto_pow-dns-rec-SRJ.git
and then I cloned.
[root@atlantis-test-cc sreejith_repo]# git clone https://github.com/8x8/auto_pow-dns-rec-SRJ.git
Cloning into 'auto_pow-dns-rec-SRJ'...
Username for 'https://github.com': sbalakrishn
Password for 'https://sbalakrishn@github.com':
remote: Enumerating objects: 26, done.
remote: Counting objects: 100% (26/26), done.
remote: Compressing objects: 100% (18/18), done.
remote: Total 26 (delta 3), reused 24 (delta 2), pack-reused 0
Unpacking objects: 100% (26/26), done.
[root@atlantis-test-cc sreejith_repo]#
How to access the Fine Grained Token.
How to authenticate agains GITHUB REPO
Syntax:
curl –u <user_name>:<Access_Token> URL of the GitHub repo
curl -u sbalakrishn:<access_token> https://github.com/8x8/auto_ansible_roles_service-fluentd.git
And the
Git pull


Comments
Post a Comment