且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在github API中使用ssh身份验证?

更新时间:2023-09-08 10:34:16

如果使用的是ssh,则永远都不会以" yrstruly "身份登录.您将始终以"git"身份进行连接.
您的公共密钥足以使GitHub识别您为" yrstruly ".
而且由于您使用的是https地址,而不是ssh地址,因此该-pubkey 选项可能会被忽略.

If you are using ssh, then you would never logon as 'yrstruly'. You would always connect as 'git'.
Your public key would be enough for GitHub to recognize you as 'yrstruly'.
And since you are using an https address, and not an ssh one, that --pubkey option is likely to be ignored.

有效的ssh地址为: ssh://git@api.github.com ,我不认为Github对其api提出了这种访问方式.

A valid ssh address would be: ssh://git@api.github.com, and I don't think Github proposes that kind of access for its api.

curl --user 选项仅对于https地址是必需的,例如"无法从Private Repo下载Git存档tarball ":

curl -sL --user "${username}:${password}" https://github.com...