なんの記事
- 久しぶりに新しいプロジェクトを作成し、リモートレポを作成しようとしたところ、以下のXcodeがエラーを吐いた。
エラー内容
エラー内容:You're using an RSA key with SHA-1, which is no longer allowed. Please use a newer client or a different key type.
![](https://qiita-user-contents.imgix.net/https%3A%2F%2Fqiita-image-store.s3.ap-northeast-1.amazonaws.com%2F0%2F535198%2F23a8f80f-7f8f-6890-f2d2-74c175e313a4.png?ixlib=rb-4.0.0&auto=format&gif-q=60&q=75&s=0ac8d9baeec183ceb065c0e5a7efa13d)
原因
- 2021年9月26日、OpenSSH 8.8がリリースされSHA-1ハッシュアルゴリズムを使用したRSA署名の廃止された
- これを受け、Githubでも、2022年の3月15日?から、SHA1ハッシュを使ったRSA署名が禁止されている(セキュリティー上の理由)
- 詳しい話は、こちら
Dropping insecure signature algorithms
RSA keys (you’ll see ssh-rsa in the public key) are stronger than DSA keys, but older Git clients may use them in combination with a dated signature algorithm that uses SHA-1. Many SSH clients, including OpenSSH 7.2 and newer, support RSA with SHA-2 signatures (signature types rsa-sha2-256 and rsa-sha2-512), which are secure. However, other clients only support the older SHA-1 signatures. SHA-1 is weak, so we’ll stop allowing new RSA client keys to use SHA-1 signatures and require them to use SHA-2 signatures instead. Keys with a valid_after date before the deadline (November 2, 2021) may continue to use SHA-1 signatures for the time being.
解決方法
- ターミナルで以下のコマンドを叩いて、ECDSAのSSH Keyを発行し、GithubにSSHKeyをアップロードする。
ssh-keygen -t ecdsa -b 521 -C “your_email@example.com
- アップロード後、xcode>preferences> accounts> githutのSSH Keyの参照先を
id_ecdsa
に変更する。 - ssh> config内に記載のIdentityFileの参照先を
id_ecdsa
に変える。 - 注意:Githubから古いSSHKeyを削除し、
ssh -T git@github.com
をコマンドに打ち込み、新しいKeyでの認証を完了させないと、認証エラーが出ます。
To Solve You're using an RSA key with SHA-1, which is no longer allowed. Please use a newer client or a different key type Error Github is now not supported RSA keys with SHA-1 and that's why you are facing this error. Here What you can do is Just create a new SSH key with ECDSA and then add this key to Github. Just run this command: ssh-keygen -t ecdsa -b 521 -C “your_email@example.com” Then Just Upload it to GitHub Just after deleting your old key first, then update the SSH2 private key to point to id_ecdsa. Now you will be able to clone repositories and Now, your error must be solved. Thank You!.
参考にした記事
- https://github.blog/2021-09-01-improving-git-protocol-security-github/
- https://exerror.com/youre-using-an-rsa-key-with-sha-1-which-is-no-longer-allowed-please-use-a-newer-client-or-a-different-key-type/#:~:text=key%20type%20Error%3F-,To%20Solve%20You're%20using%20an%20RSA%20key%20with%20SHA,add%20this%20key%20to%20Github.