git clone コマンドで「Permission denied (publickey). fatal: Could not read from remote repository.」のエラーが出力された場合の対処方法です。
git clone コマンドで「fatal: Could not read from remote repository.」が出力された場合の対処方法
git clone コマンド実行時のエラーです。
[test@SAKURA_VPS ~]$ git clone git@github.com:neologd/mecab-ipadic-neologd.git
Cloning into ‘mecab-ipadic-neologd’… Permission denied (publickey). fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
[test@SAKURA_VPS ~]$
Git 用の鍵を作成する
Git 用に鍵を作成する場合です。
[test@SAKURA_VPS ~]$ ssh-keygen -C “git@github.com” -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/test/.ssh/id_rsa): /home/test/.ssh/id_rsa_git ← 任意のディレクトとファイル名で鍵を作成します。(既存の鍵を上書きで壊さないように注意します)
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/test/.ssh/id_rsa_git.
Your public key has been saved in /home/test/.ssh/id_rsa_git.pub.
The key fingerprint is:
SHA256:lHG7DMrNugxxxxxxxxxxxxxxxxxxxxKlWeSsY git@github.com
The key’s randomart image is:
+—[RSA 2048]—-+
| . . +**|
| + . ..++|
| +.. = =+.|
| . = o++ E +.|
| o Soo++.o .|
| .* +..o. .|
| o .o B . . |
| . + .+ . |
| . +o . |
+—-[SHA256]—–+
[test@SAKURA_VPS ~]$
コメント