~$ sudo npm install hexo ~$ echo'PATH="$PATH:./node_modules/.bin"' >> ~/.profile ~$ hexo init blog ~$ cd blog ~/blog$ npm install ~/blog$ hexo server INFO Validating config INFO Start processing INFO Hexo is running at http://localhost:4000/ . Press Ctrl+C to stop.
xuan@xuan:~$ ssh-keygen -t ed25519 -C "friendxuan@163.com" Generating public/private ed25519 key pair. Enter file in which to save the key (/home/xuan/.ssh/id_ed25519): Created directory '/home/xuan/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/xuan/.ssh/id_ed25519 Your public key has been saved in /home/xuan/.ssh/id_ed25519.pub The key fingerprint is: SHA256:7C9d6/A9LnqxkoLZybKFbtjVXXOQ04Rkfs5Brs3G5fA friendxuan@163.com The key's randomart image is: +--[ED25519 256]--+ | .o*.| | oB .| | o=o| | . BB+| | S. . o BE| | o. . + . | | o.*oo.o + | | ..*.*.+o=.. | | .oo oo=ooo. | +----[SHA256]-----+
步骤 2:添加 SSH 密钥到 GitHub
1 2 3
cat ~/.ssh/id_ed25519.pub 登录 GitHub 账户,进入 Settings > SSH and GPG keys > New SSH key。 将公钥粘贴到 Key 字段中,并为其命名,然后保存。
运行以下命令以验证 SSH 配置是否正确: ssh -T git@github.com 如果看到类似以下输出,则配置成功: Hi friendxuan! You've successfully authenticated, but GitHub does not provide shell access.
xuan@xuan:~/blog$ ssh -T git@github.com Hi friendxuan! You've successfully authenticated, but GitHub does not provide shell access.