Mac配置github公钥 publickey

flutter运行到ios上出现错误

[!] Error installing FMDB
[!] /usr/bin/git clone https://github.com/ccgus/fmdb.git /var/folders/mc/y59d1hd50p7fw44vnj_v__s40000gn/T/d20200618-23917-1mcxpjh --template= --single-branch --depth 1 --branch 2.7.5

Cloning into '/var/folders/mc/y59d1hd50p7fw44vnj_v__s40000gn/T/d20200618-23917-1mcxpjh'...
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.





原因是没有配置github公钥,解决办法

github账号 [email protected]为例
终端输入:

ssh-keygen -t rsa -b 4096 -C "[email protected]"

192:~ abc$ ssh-keygen -t rsa -b 4096 -C "[email protected]"
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/abc/.ssh/id_rsa):




设置密码,可以直接回车跳过

Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /Users/abc/.ssh/id_rsa.
Your public key has been saved in /Users/abc/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:nO/2ou/VPRpS/aufbjXyiAkWytrL3REp/nSJNaxRGJc [email protected]
The key's randomart image is:
+---[RSA 4096]----+
|           . ..  |
|            +E   |
|           . .   |
|       . o  + .  |
|      . S..+ = . |
|       o.+. Boooo|
|      o ..o*++=.=|
|     .....*++.oo+|
|       oo*+=.o== |
+----[SHA256]-----+




查看公钥并复制

cat id_rsa.pub

192:.ssh abc$ cat id_rsa.pub
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
== [email protected]




在github中设置密钥
Setting > SSH and GPG keys > new SSH keys

image

你可能感兴趣的:(Mac配置github公钥 publickey)