配置ssh

149 字

Hexo 使用 SSH 部署到 GitHub 完整指南

生成 SSH Key

在命令行(CMD、PowerShell 或 Git Bash)执行:

1
ssh-keygen -t rsa -C "GitHub-Email@example.com"

测试ssh

1
ssh -T git@github.com

第一次连接时会提示:

1
2
The authenticity of host 'github.com (IP)' can't be established.
Are you sure you want to continue connecting (yes/no)?

输入yes并回车,如果显示:

1
Hi <用户名>! You've successfully authenticated...

说明SSH配置成功

注意事项

默认SSH端口会使用22端口,若22端口被墙,则用443端口。

22端口格式:

1
git@github.com:User/repo.git

443端口格式:

1
ssh://git@ssh.github.com:443/User/repo.git