Hui-Shao's Blog

Just do it...

分享一些通常建站时需要做的事情、注意事项,以及常用的Centos命令

一般步骤

  1. 安全性设置 例如: 防火墙、SSH、SELinux
  2. 安装建站环境 可以用 宝塔面板 解决
  3. 建站具体配置
  4. 设置自动备份
  5. 其他一些自己想干的事情
阅读全文 »

起因

众所周知,Hexo 博客在 deploy 时,默认使用的是 Git全局用户。近期因为个人需要,在一台PC上配置了多个 git账户(取消了全局用户设置),导致 执行 hexo d 时报错,提示需要配置用户名。

因此,我们需要 “为 Hexo 博客单独配置指定的 git 用户” 。不过网上的教程大部分都是设置全局用户的方法,在一番折腾之后,我终于找到了的解决方案,就此分享一下。

阅读全文 »

Why?

关于 ssh-key 与 deploy-key

ssh-key 是用于认证 Github 账户的密钥,对所有的 repository (下文简写为 repo ) 都有操作权限;而 deploy-key 只允许对特定 repo 进行操作,每个 repo 的 deploy key 都是独有的,其他 repo 无法使用相同的 key。

下面是 Github 官方的说明:

Deploy key is a SSH key set in your repo to grant client read-only (as well as r/w, if you want) access to your repo.

As the name says, its primary function is to be used in the deploy process, where only read access is needed. Therefore keep the repo safe from the attack, in case the server side is fallen.

出于安全考虑(尝试新事物),我决定为托管在 Github 上的这个博客配置单独的 deploy-key.

阅读全文 »
0%