LoginSignup
0
1

More than 1 year has passed since last update.

remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.

Last updated at Posted at 2021-08-14

git clone、git push しようとしたらエラーがでた。

remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
・・・ 省略 ・・・
: The requested URL returned error: 403
【日本語翻訳】
リモート:パスワード認証のサポートは2021年8月13日に削除されました。代わりに個人アクセストークンを使用してください。

GitHubのパスワード認証を2021年8月13日に廃止するとのことでした。。。

個人アクセストークン取得手順

1|https://github.com/settings/tokensにアクセスする
2|「Generate new token」をクリック
img1.png
3|「Note」にトーク名を設定、「Generate token」をクリック
img2.png

4|生成されたトークンをコピー
※ ページを離れると再度コピーできなくなるので注意

試しに「git clone・・・」してみたが、、、

Cloning into 'リポジトリ名'...
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
【日本語訳】
'リポジトリ名'へのクローン作成...
git@github.com:アクセスが拒否されました(公開キー)。
致命的:リモートリポジトリから読み取ることができませんでした。

正しいアクセス権があることを確認してください
リポジトリが存在します。

何故なんだ、、、
本来であれば下記のようにパスワードを求められるはずなのに、、、、

$ git clone https://github.com/username/repo.git
Username: your_username
Password: your_token

Macのキーチェーンで保存されているパスワードを変更

キーチェーンで保存されているgithubのパスワードを変更することで解決することがわかりました。
1|「command + スペース」で「spotlight」を出し「Keychain Access.app」を検索
2|右上の検索から「github」で検索
3|「インターネットパスワード」の青いgitthubをクリック
4|パスワードを表示させてコピーしたトークン(ghp_・・・)をここにペーストして保存

最後に

最後に「git clone」してみると...

Cloning into 'リポジトリ名'...
remote: Enumerating objects: 198, done.
remote: Counting objects: 100% (198/198), done.
remote: Compressing objects: 100% (145/145), done.
remote: Total 198 (delta 37), reused 187 (delta 26), pack-reused 0
Receiving objects: 100% (198/198), 58.39 KiB | 398.00 KiB/s, done.
Resolving deltas: 100% (37/37), done.

無事にクローンすることができました。

参考サイト

公式ドキュメント
ほげさん

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1