给远程服务器设置SSH Key免密码登录

最近新入手一台VPS,为了安全以及远程连接方便,设置成使用SSH Key免密码登录。作为非程序员IT小白,Google了不少教程,按自己的折腾过程,汇总成下面的步骤,作为以后再搞机的指南。 主要参考豆比根据地的教程。 1.远程服务器上生成密钥对 用SSH连接远程服务器后,执行以下命令: 1 2 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. ...

2018年6月22日 · 4 分钟 · tsingk