github配置和使用

通过手册指导生产ssh key或取已有的ssh key

github配置和使用_第1张图片

 

root@iZwz93telmwbh624e5zetqZ:~# ls -al ~/.ssh
total 8
drwx------  2 root root 4096 Jun 20 08:31 .
drwx------ 13 root root 4096 Oct 25 01:23 ..
-rw-------  1 root root    0 Aug 20 09:14 authorized_keys

root@iZwz93telmwbh624e5zetqZ:~# ssh-keygen -t rsa -b 4096 -C "[email protected]"
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase):                 #这里输入的是pull push密码
Enter same passphrase again: 
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:sbLxozqlCHZcdyMqvwl2uEJffZ4q3xuDbKgAjaKxlAo 249757247@qq.com
The key's randomart image is:
+---[RSA 4096]----+
|                 |
|                 |
|        .        |
| o.  . o =       |
|Eoo . * S .      |
|O= +.o+*..       |
|*oo=+=.+=o.      |
| .+.Boo..+o      |
|  .o.==o.o.      |
+----[SHA256]-----+
root@iZwz93telmwbh624e5zetqZ:~# ll /root/.ssh/
total 16
drwx------  2 root root 4096 Oct 25 01:35 ./
drwx------ 13 root root 4096 Oct 25 01:23 ../
-rw-------  1 root root    0 Aug 20 09:14 authorized_keys
-rw-------  1 root root 3326 Oct 25 01:35 id_rsa
-rw-r--r--  1 root root  742 Oct 25 01:35 id_rsa.pub
root@iZwz93telmwbh624e5zetqZ:~# cat /root/.ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDEmUXTtV7IjNwAe7uOrDrhw+YCUMkO581+JjKG+5Sd6EPzHk0a+218aqP313PUG6yzy77ApPmK6unSgDX3+dN6FtIvJfLBbpGGS+2yuWj8XiyOI9neqU3irc9Haqy6P2K18/8GoSrLmpyfbVLuBEV9O4U62NtpM/YJAoQ00Pj7akJTkuQ1rLJ/9UVf6DGpEeyxwS+BKW0QRgnoCwDBwjcU0xQMSysEtWpYLtw36KqDBQDIdBYRqaqiYCm8U2DeaptkMtlsU2M92mPEE/GOzFlWttXfHhBCktfJRlyFysvFrEOUrZ9PLICFX4bW/eBEuGakGB3iqOwpRvvOoWSv7uaL0sc6x96XfTH3ks5LAJ6VKIvSjBw9BWlky+LGtammupqVKZJVV1WCJu5kp9B2FFUl1BdjtcUXEo6salfhmkXPPgAQF3OfqdrDN6KszijtNom0TVJCwTgtR/iW3etCNX25LRwV/zpfS2yrsAupqZf7fPRoxfRDjSynRaIK778+gLqhkRrWktw6nmxifZoeA7MjQ9pSBFkyqGY5pI4BQ3woRvjUp/BxyXIEGJNQeRrVx/pV+pCuDjwA0e4IXD0EhMQNLNp6Jeihl5cw+e/gUg0cPGf18BETZB52vZhzkdf7rVec/Fc8VLO4b5b/oVxcB2rI54N6hx89zfp5hjjKlzuDRw== [email protected]
root@iZwz93telmwbh624e5zetqZ:~#

 

 

 

 

 

 

 

 

 

 

 

github配置和使用_第2张图片

 

root@iZwz93telmwbh624e5zetqZ:~# ssh -T [email protected]
The authenticity of host 'github.com (13.250.177.223)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,13.250.177.223' (RSA) to the list of known hosts.
Enter passphrase for key '/root/.ssh/id_rsa': 
Hi hnhycnlc888! You've successfully authenticated, but GitHub does not provide shell access.

root@iZwz93telmwbh624e5zetqZ:~# pwd
/root
root@iZwz93telmwbh624e5zetqZ:~# ls
download  dump.rdb  php_extension  telpo
root@iZwz93telmwbh624e5zetqZ:~# git clone https://github.com/hnhycnlc888/helloworld.git
Cloning into 'helloworld'...
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Total 3 (delta 0), reused 3 (delta 0), pack-reused 0
Unpacking objects: 100% (3/3), done.
Checking connectivity... done.
root@iZwz93telmwbh624e5zetqZ:~# ls
download  dump.rdb  helloworld  php_extension  telpo
root@iZwz93telmwbh624e5zetqZ:~# ll helloworld/
total 16
drwxr-xr-x  3 root root 4096 Oct 25 01:46 ./
drwx------ 14 root root 4096 Oct 25 01:46 ../
drwxr-xr-x  8 root root 4096 Oct 25 01:46 .git/
-rw-r--r--  1 root root   13 Oct 25 01:46 README.md
root@iZwz93telmwbh624e5zetqZ:~# cat helloworld/.git/config
[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
[remote "origin"]
    url = https://github.com/hnhycnlc888/helloworld.git
    fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
    remote = origin
    merge = refs/heads/master
root@iZwz93telmwbh624e5zetqZ:~#

 

你可能感兴趣的:(github配置和使用)