githubからパスワード認証ができなくなったときの対処

githubをパスワード認証で使っているときにこういうエラーが出た場合。

remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.

personal access tokenを使えという風に出ているが、手元の環境ではうまくいかなかったので
SSH公開鍵認証に切り替えて事なきを得た。

SSH公開鍵をgithubに設定する手順はこちらを参照。

ただしhttpsでcloneしているリポジトリはssh版のリモートリポジトリに設定する必要がある。

git remote set-url origin git@github.com/<username>/<repositoryname>.git

参考
https://stackoverflow.com/questions/68775869/support-for-password-authentication-was-removed-please-use-a-personal-access-to

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です