git配置sshkey

fanxi@fanxi-Lenovo-B51-35:~/桌面/myblog$ mkdir ~/.ssh
mkdir: 无法创建目录"/home/fanxi/.ssh": 文件已存在
fanxi@fanxi-Lenovo-B51-35:~/桌面/myblog$ cd ~/.ssh
fanxi@fanxi-Lenovo-B51-35:~/.ssh$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/fanxi/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/fanxi/.ssh/id_rsa.
Your public key has been saved in /home/fanxi/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:2FErsmivtwDdCJLhn+lJcH9VusJVLFOzuhBTdVeCTRU fanxi@fanxi-Lenovo-B51-35
The key's randomart image is:
+---[RSA 2048]----+
|.        .=* =oE=|
|.o      .++o= o. |
|oo..  .oo++.     |
| .+o++.==oo      |
|  .==.+=So       |
|  oo... o .      |
|   o. .  .       |
|     o.          |
|    ....         |
+----[SHA256]-----+
fanxi@fanxi-Lenovo-B51-35:~/.ssh$ cat ~/.ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDVKdKF7K2FIfPnsiiu8z7lr66HDcc+GyirKvO524Q/EH7zPJvfutgEdg31nLbzfopHlwXMxPe3W/wsfZqQdd4s2+WidYayMF6vCv6uDHqtw+6VkaWW/5gJ0MAlCvnOujY1TnxGuapzcGuVdchNE+funEhLJmZCWHi7qoOV+maKtIyllWywpnWwnR24k62Djbl7mZPEe58cgcFtEokf+B+5oUxlyCL8kgJWWcCFU4RxIHKloDfq3EN+vwDiYDgfaTCa+9cGb00I2EuCwSAuW5ItwEldeVutZ0qweXq+VxBREmoFPAIYFXuIO8uGFbTaiv7Qi8dZgd+OEAln0gh/yfmZ fanxi@fanxi-Lenovo-B51-35
fanxi@fanxi-Lenovo-B51-35:~/.ssh$ git config -global user.name"fuhanshi"
error: did you mean `--global` (with two dashes ?)
fanxi@fanxi-Lenovo-B51-35:~/.ssh$ 
fanxi@fanxi-Lenovo-B51-35:~/.ssh$ git config  --global user.name"fuhanshi"
fanxi@fanxi-Lenovo-B51-35:~/.ssh$ git config  --global user.email"1433758491@qq.com"
fanxi@fanxi-Lenovo-B51-35:~/.ssh$ ssh -Tgit@github.com
Warning: Identity file t@github.com not accessible: No such file or directory.
usage: ssh [-46AaCfGgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec]
           [-D [bind_address:]port] [-E log_file] [-e escape_char]
           [-F configfile] [-I pkcs11] [-i identity_file]
           [-J [user@]host[:port]] [-L address] [-l login_name] [-m mac_spec]
           [-O ctl_cmd] [-o option] [-p port] [-Q query_option] [-R address]
           [-S ctl_path] [-W host:port] [-w local_tun[:remote_tun]]
           [user@]hostname [command]
fanxi@fanxi-Lenovo-B51-35:~/.ssh$ ssh -T git@github.com
Hi fuhanshi! You've successfully authenticated, but GitHub does not provide shell access.
fanxi@fanxi-Lenovo-B51-35:~/.ssh$ 
凡希 wechat
喜欢所以热爱,坚持干货分享,欢迎订阅我的微信公众号
呐,请我吃辣条