0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

[Github] remote: Support for password authentication was removed on August 13, 2021.の対処法

Last updated at Posted at 2025-01-16

はじめに

Git CLIを使用してリポジトリをクローンしようとした時に、Githubのアカウントのパスワードを入れると、

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.

というエラーが出ます。

普段Github Desktopを使用していて、この対処法をよく忘れてしまうので、メモしておきます。

原因

エラーメッセージのURLにアクセスしてみると,

セキュリティのため、パスワードによる認証を廃止したようです。

代わりに、個人用アクセストークンを入力します。

解決法

ます、Githubでログインし、自分のアイコンをクリック->「設定」を開きます。

ScreenShot 2025-01-17 4.32.41.png

左のメニューの一番下の「Developer Setting」を開きます。

ScreenShot 2025-01-17 4.35.44.png

ここで、「Personal access tokens」のFine-grained tokens」を開き、「Generate new token」ボタンをクリックします。

  • token name:トークンの名前
  • Expiration:トークンの有効期限
  • Repository access:必要に応じて選択
  • Permissions:必要に応じて選択

上記の設定が終わったら「Generate」ボタンを押します。
生成されたトークンはこの画面でのみコピーができるので、忘れずにコピーして保存しておいてください。

あとは、このトークンを使用してgitの操作を行うことができます。

終わりに

個人用アクセストークンには、

  • Personal access token(classic)
  • Fine-grained tokens

の2種類があり、公式ドキュメントでは後者を勧めていました。
しかし、前者でなければできないこと(例えば自分が所有していないリポジトリへのアクセスなど)があるようです。

0
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?