VPS一键启用SSH密钥安全登录

简介:

使用VPS时,经常会遇到SSH爆破,一旦我们使用弱密码,无形中产生很多安全隐患。为了用户以及个人的信息安全,我推荐大家启用密钥登陆,同时关闭密码登陆。

其实强密码也可以达到密钥登陆的安全性,不过强密码带来的不便远远大于密钥方式,同时通过一键脚本开启密钥登陆比修改密码更快捷。

脚本源于:https://github.com/KiritoMiao/SSHKEY_Installer

 
准备:

首先我们需要生成一对密钥,通过Xshell生成是最简便的方式。

点击工具→用户密钥管理者→生成。

私钥我们需要妥善保存,不能传播出去,将公钥复制,导入Github中:https://github.com/settings/keys

 
接下来我们在VPS运行脚本即可(括号以及内部文字要改成你的Github用户名):

wget https://raw.githubusercontent.com/Chiakge/SSHKEY_Installer/master/key.sh --no-check-certificate&& bash key.sh [你的Github用户名]

 
总结:

开启方法非常简单也非常安全,平时登陆也免除了输入密码的烦恼。

3 评论

  1. Good day to you,
    I am Mr. Juan Alejandro Perez, a Spanish lawyer. I have previously sent you an email regarding a transaction of $13.5 million left by my late client before his tragic death.
    I am contacting you once again because after going through your profile, I strongly believe that you will be in a better position to execute this business transaction with me. Please if you are interested to proceed with me kindly respond to my email urgently for more detail information.
    This transaction is 100% risk free and 10% of the total fund will be donated among charity organizations while the remaining will be shared equal by the both of us upon a successful conclusion of the fund transfer to your nominated Bank account. Please advice urgently.
    Yours Faithfully,
    Br. juan Alejandro Perez
    Tel: +34 919 017 821
    Email: perez@japlawfirm.com

发表评论

电子邮件地址不会被公开。 必填项已用*标注

*

code