跳至主要內容
通过密钥登陆服务器

在使用 Github Action 自动化部署博客时,需要用到密钥来登录服务器,在这里记录一下具体步骤和其中踩过的一些坑

生成密钥对

root/.ssh目录中生成公私钥

[root@CentOSAli ~]# ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Created directory '/root/.ssh'.
Enter passphrase (empty for no passphrase):
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.

logycoconut小于 1 分钟关于技术ssh