此时,在 eiSouthBoy.github.io 仓库页面,进入到仓库的Settings–>Pages,可以看到Github提供的Github Pages,给出了网址:Your site is live at https://eisouthboy.github.io/,可以在浏览器输入网址直接访问的。
# 进入ubuntu22.04容器 docker exec -it -u cj 52e0bd6293ac /usr/bin/bash
cd /workspace/blog git config --global user.name=eiSouthBoy git config --global user.email=caoj97141@gmail.com
git用户名和邮箱添加后,此时可以生成公钥了
1 2 3
# 该命令有交互,默认全部回车即可 ssh-keygen -t rsa
该命令执行完毕后,提示公钥文件保存的路径
1 2 3 4 5 6
cj@52e0bd6293ac:/workspace/blog$ ll ~/.ssh/ total 28 drwx------ 2 cj cj 4096 Aug 11 03:53 ./ drwxr-x--- 1 cj cj 4096 Aug 11 07:57 ../ -rw------- 1 cj cj 2602 Aug 11 03:48 id_rsa -rw-r--r-- 1 cj cj 569 Aug 11 03:48 id_rsa.pub
将公钥信息上传到Github,即将id_rsa.pub文件内容复制到Github的github个人图像 –> Settings –> SSH and GPG Keys –> New SSH Key,点击创建,就会创建SSH Key信息。该信息形式如下所示(为了不保留个人信息,SHA256隐藏了关键信息):
1 2 3 4
cj@52e0bd6293ac SHA256:******************************************* Added on Aug 11, 2024 Last used within the last week — Read/write
测试 SSH 是否能连接到 GitHub 的 SSH 服务器
1
ssh -T git@github.com
出现如下提示,即说明本地能够通过SSH连接到Github的SSH服务器
1 2
Hi eiSouthBoy! You've successfully authenticated, but GitHub does not provide shell access.
# 修改第一处 # URL ## Set your site url here. For example, if you use GitHub Page, set url as 'https://username.github.io/project' url:https://eisouthboy.github.io
cj@52e0bd6293ac:/workspace/blog$ hexo d INFO Validating config INFO Deploying: git INFO Clearing .deploy_git folder... INFO Copying files from public folder... INFO Copying files from extend dirs... On branch master nothing to commit, working tree clean Enumerating objects: 74, done. Counting objects: 100% (74/74), done. Delta compression using up to 12 threads Compressing objects: 100% (29/29), done. Writing objects: 100% (43/43), 21.26 KiB | 3.54 MiB/s, done. Total 43 (delta 19), reused 0 (delta 0), pack-reused 0 remote: Resolving deltas: 100% (19/19), completed with 14 local objects. To github.com:eiSouthBoy/eiSouthBoy.github.io.git bbb8d53..60a542a HEAD -> main Branch 'master'set up to track remote branch 'main' from 'git@github.com:eiSouthBoy/eiSouthBoy.github.io.git'. INFO Deploy done: git
cj@52e0bd6293ac:/workspace/blog$ hexo d INFO Validating config INFO Deploying: git INFO Clearing .deploy_git folder... INFO Copying files from public folder... INFO Copying files from extend dirs... [main 6aa2596] Site updated: 2024-08-11 10:04:48 4 files changed, 28 insertions(+), 10 deletions(-) Enumerating objects: 21, done. Counting objects: 100% (21/21), done. Delta compression using up to 12 threads Compressing objects: 100% (7/7), done. Writing objects: 100% (11/11), 3.32 KiB | 1.66 MiB/s, done. Total 11 (delta 5), reused 0 (delta 0), pack-reused 0 remote: Resolving deltas: 100% (5/5), completed with 5 local objects. To github.com:eiSouthBoy/eiSouthBoy.github.io.git 60a542a..6aa2596 HEAD -> main Branch 'main'set up to track remote branch 'main' from 'git@github.com:eiSouthBoy/eiSouthBoy.github.io.git'. INFO Deploy done: git