惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
The Exploit Database - CXSecurity.com
A
Arctic Wolf
K
Kaspersky official blog
T
Threat Research - Cisco Blogs
PCI Perspectives
PCI Perspectives
www.infosecurity-magazine.com
www.infosecurity-magazine.com
P
Privacy International News Feed
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
U
Unit 42
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Simon Willison's Weblog
Simon Willison's Weblog
P
Privacy & Cybersecurity Law Blog
O
OpenAI News
量子位
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
C
Cisco Blogs
AWS News Blog
AWS News Blog
Vercel News
Vercel News
Microsoft Security Blog
Microsoft Security Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
美团技术团队
T
Threatpost
S
Schneier on Security
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
C
Cyber Attacks, Cyber Crime and Cyber Security
Last Week in AI
Last Week in AI
C
CERT Recently Published Vulnerability Notes
Blog — PlanetScale
Blog — PlanetScale
C
Cybersecurity and Infrastructure Security Agency CISA
F
Full Disclosure
博客园_首页
N
Netflix TechBlog - Medium
Security Latest
Security Latest
有赞技术团队
有赞技术团队
Google DeepMind News
Google DeepMind News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
The Register - Security
The Register - Security
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Recent Announcements
Recent Announcements
博客园 - Franky
P
Palo Alto Networks Blog
Project Zero
Project Zero
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
H
Help Net Security
Hacker News: Ask HN
Hacker News: Ask HN
Cisco Talos Blog
Cisco Talos Blog
H
Heimdal Security Blog
The Hacker News
The Hacker News
博客园 - 【当耐特】
GbyAI
GbyAI

Rat's Blog - ssh

Linux VPS安装Google Authenticator实现SSH登陆二次验证 - Rat's Blog Xshell 6官方永久免费版,可解决评估期已过的提示问题 - Rat's Blog 一款全新且强大的SSH客户端:FinalShell - Rat's Blog 一款非常好用的Web端SSH工具:GateOne安装教程 - Rat's Blog JuiceSSH/Termius:安卓/IOS平台上好用且免费的SSH客户端 - Rat's Blog 一个可以在浏览器上运行的SSH客户端:WebSSH2安装教程 - Rat's Blog Linux VPS服务器SSH端口一键修改脚本 - Rat's Blog SSH密钥安装器升级,一键安装VPS密钥安全登录 - Rat's Blog Ubuntu 安装Fail2ban服务来防止暴力破解FTP/SSH - Rat's Blog
为Linux VPS配置SSH-KEY登录并禁用root密码 - Rat's Blog
博主: Rat's · 2017-07-30 · via Rat's Blog - ssh

说明:很多人可能喜欢剁手,买了很多VPS,密码也记不住,也容易被大量的扫描器扫描爆破(检测扫描方法参考:通过Auth.log来查看SSH是否被扫)。这时候我们可以利用SSH-KEY方式登录服务器可以很好的解决被爆破和忘记密码的问题!

1、登录Linux主机生成并配置SSH-KEY

ssh-keygen -t rsa
Enter file in which to save the key (/root/.ssh/id_rsa): 建议直接回车使用默认路径
Enter passphrase (empty for no passphrase): 输入密码短语(留空则直接回车)
Enter same passphrase again: 重复密码短语

此时在/root/.ssh/目录下生成了2个文件,id_rsa为私钥,id_rsa.pub为公钥。私钥自己下载到本地电脑妥善保存(丢了服务器可就没法再登陆了),为安全,建议删除服务器端的私钥。公钥则可以任意公开。

2、导入KEY文件

cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys

3、修改SSH的配置文件/etc/ssh/sshd_config
可以借助WinSCP工具登录VPS进行编辑修改!

RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
PasswordAuthentication no

进行上述修改后我们就完成了关闭root并启用SSH-KEY登录方式。

重启SSH服务

#CentOS系统
service sshd restart
#Debian/Ubuntu系统
service ssh restart

4、通过Xshell用SSH-KEY方式登录
请输入图片描述
最后导入密匙即可!


版权声明:本文为原创文章,版权归 Rat's Blog 所有,转载请注明出处!

本文链接:https://www.moerats.com/archives/229/

如教程需要更新,或者相关链接出现404,可以在文章下面评论留言。

Vultr新用户注册送100美元/16个机房按小时计费,支持支付宝,【点击查看】。