当前位置:网站首页>云服务器设置ssh密钥登录
云服务器设置ssh密钥登录
2022-07-04 22:30:00 【宋小羽】
- 客户端生成公钥和私钥
ssh-keygen -t rsa -b 4096 -C "[email protected]" - 上传公钥到服务器
scp ~/.ssh/id_rsa.pub [email protected]服务器地址:/root - 登录到服务器
- 创建.ssh 文件
mkdir /root/.ssh - 创建文件
cd /root/.ssh touch authorized_keys - 添加私钥
cat id_rsa.pub >> /root/.ssh/authorized_keys - 添加权限
chmod -R 700 .ssh
# ssh配置文件所在
vim /etc/ssh/sshd_config
# 重启ssh
systemctl restart sshd.service
参考文档
https://developer.aliyun.com/article/641091
注意博文中的chown是更改所有者,chmod才是改权限
边栏推荐
- On-off and on-off of quality system construction
- Solana chain application crema was shut down due to hacker attacks
- Feature scaling normalization
- Analysis of environmental encryption technology
- Redis入门完整教程:Redis Shell
- Redis入门完整教程:Pipeline
- Google Earth Engine(GEE)——基于 MCD64A1 的 GlobFire 日常火灾数据集
- 图片懒加载的原理
- Redis入门完整教程:慢查询分析
- 新版判断PC和手机端代码,手机端跳转手机端,PC跳转PC端最新有效代码
猜你喜欢

Redis入门完整教程:Bitmaps

Attack and defense world misc advanced area can_ has_ stdio?

Unity修仙手游 | lua动态滑动功能(3种源码具体实现)

Mongodb aggregation operation summary

NFT insider 64: e-commerce giant eBay submitted an NFT related trademark application, and KPMG will invest $30million in Web3 and metauniverse

攻防世界 MISC 进阶区 Ditf

Google Earth engine (GEE) - tasks upgrade enables run all to download all images in task types with one click

MySQL Architecture - logical architecture

Li Kou 98: verify binary search tree

集群的概述与定义,一看就会
随机推荐
通过Go语言创建CA与签发证书
【lua】int64的支持
Solana chain application crema was shut down due to hacker attacks
Redis入门完整教程:慢查询分析
Talk about Middleware
Attack and defense world misc advanced grace-50
The Sandbox 和数字好莱坞达成合作,通过人力资源开发加速创作者经济的发展
Redis入门完整教程:Bitmaps
Insert sort, select sort, bubble sort
Redis入門完整教程:Pipeline
MD5 tool class
LOGO特训营 第二节 文字与图形的搭配关系
攻防世界 MISC 進階區 Erik-Baleog-and-Olaf
Serial port data frame
La prospérité est épuisée, les choses sont bonnes et mauvaises: Où puis - je aller pour un chef de station personnel?
Analog rocker controlled steering gear
Breakpoint debugging under vs2019 c release
都说软件测试很简单有手就行,但为何仍有这么多劝退的?
Now MySQL cdc2.1 is parsing the datetime class with a value of 0000-00-00 00:00:00
Attack and defense world misc advanced zone 2017_ Dating_ in_ Singapore