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

推荐订阅源

阮一峰的网络日志
阮一峰的网络日志
D
Darknet – Hacking Tools, Hacker News & Cyber Security
S
Schneier on Security
The Last Watchdog
The Last Watchdog
Cyberwarzone
Cyberwarzone
S
Securelist
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
Cyber Attacks, Cyber Crime and Cyber Security
L
Lohrmann on Cybersecurity
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 司徒正美
The Cloudflare Blog
V
V2EX
博客园_首页
博客园 - 聂微东
Vercel News
Vercel News
人人都是产品经理
人人都是产品经理
G
GRAHAM CLULEY
T
Tenable Blog
Last Week in AI
Last Week in AI
Y
Y Combinator Blog
L
LINUX DO - 最新话题
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
SecWiki News
SecWiki News
博客园 - 三生石上(FineUI控件)
S
Secure Thoughts
N
News | PayPal Newsroom
T
The Blog of Author Tim Ferriss
The GitHub Blog
The GitHub Blog
T
Troy Hunt's Blog
博客园 - 【当耐特】
Forbes - Security
Forbes - Security
H
Hacker News: Front Page
A
About on SuperTechFans
B
Blog RSS Feed
Engineering at Meta
Engineering at Meta
MongoDB | Blog
MongoDB | Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
罗磊的独立博客
D
DataBreaches.Net
P
Privacy & Cybersecurity Law Blog
Schneier on Security
Schneier on Security
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Google DeepMind News
Google DeepMind News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Jina AI
Jina AI
D
Docker
P
Proofpoint News Feed

Ssh on 轻风云

暂无文章

win11自带SSH免密登录Linux
2022-08-31 · via Ssh on 轻风云

前言

使用win11自带的SSH工具登录Linux,不需要每次都输入密码。网上找了很多教程才找到合适的,重新整理和操作并记录下来,给相同需求的小伙伴提供参考。(所有的操作都是在win11的CMD命令行)

生成公钥文件

1
ssh-keygen -t rsa -c "admin@aaayun.cc"

上传公钥文件(win11)

找到自己的公钥路径 (C:\Users\你的用户名.ssh)

1
scp C:\Users\anderyly\.ssh\id_rsa.pub root@192.168.2.222:~/.ssh

重命名公钥文件

  1. 登录linux,此时仍需要密码登陆
  1. 重命名公钥文件
1
2
cd /root/.ssh
mv id_rsa.pub authorized_keys

修改文件权限

  1. 修改文件权限
1
2
chmod 600 authorized_keys
chmod 700 /root/.ssh
  1. 修改SSH配置文件
1
vim /etc/ssh/sshd_config

保证这三句不被注释掉,如果没有则添加新的对应的语句,我需要添加"RSAAuthentication yes"

RSAAuthentication yes PubkeyAuthentication yes AuthorizedKeysFile .ssh/authorized_keys

1
2
3
4
5
6
7

保存退出

  3. 重新启动SSH服务(Linux)
    
```shell
systemctl restart sshd