当前位置:网站首页>ssh 设置密钥认证登录
ssh 设置密钥认证登录
2022-08-06 18:15:00 【为为为什么】
SSH 登录安全又方便,但是输密码很不方便,本文记录密钥SSH登录的方法流程。
实验环境
- 登录机器 Windows
- 被登录机器 Ubuntu
操作流程
生成私钥公钥
ssh-keygen- 在ssh路径下得到
id_rsa,id_rsa.pub
Linux 下在
~/.ssh文件夹 Windows 在C:/Users/Administrator/.ssh/目录下
将公钥放在 authorized_keys 中
- 公钥文件
id_rsa.pub - 将文件内容复制到
authorized_keys中
配置 config 文件
- 在
.ssh文件夹下编辑config文件 - 加入内容:
Host omv
HostName 192.168.1.111
User vvd
Port 22
IdentityFile ~\.ssh\id_rsa
IdentitiesOnly yes密钥访问ssh
- 在终端执行:
$ ssh omv
Linux omv 5.10.0-0.bpo.9-amd64 #1 SMP Debian 5.10.70-1~bpo10+1 (2021-10-10) x86_64
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Tue Feb 8 23:20:25 2022 from 192.168.1.4
[email protected]:~$- 即可免密安全登录 ssh 终端
参考资料
边栏推荐
- 论文阅读笔记(五)——利用增强掩模R-CNN实例分割方法从图像中提取个体牛的轮廓
- excel表格怎么求和一行
- 电容器选型指南-电子元器件选型指导系列
- 配置用户片段代码生成器
- 电脑一键重装系统发现内存占用率过高怎么办
- ESP8266-Arduino programming example-force sensitive resistance sensor
- Secrets默认是不加密存在etcd的
- ubuntu18.04安装mysql5.7并配置数据存储路径
- Euro-NCAP-HWA test procedure Chinese version
- Talking about the Jmeter performance test process
猜你喜欢

【浏览器】1403- 你不知道的浏览器页面渲染机制

七夕,你来人间一趟,总要谈一场轰轰烈烈的恋爱

基于显扬科技3D机器视觉HY-M5的金属零件测量系统

word怎么公式求平均值

Sketch91:如何设置对齐的参考对象,根据指定元素进行对齐教程

Unity2D horizontal version game tutorial final chapter - main menu and pause menu

12 异常处理器

亚马逊测评系统是什么,跨境卖家如何通过自己养号来实现快速出单?

Euro-NCAP-HWA test procedure Chinese version

unity2D横版游戏教程终章-主菜单和暂停菜单
随机推荐
用u盘装系统教程操作图解
Butterfly magic change: URL card plug-in label
Is it necessary to do code review to test the code that students participated in the development of?
shell 字符串截图命令之cut、printf、awk、sed命令
Euro-NCAP-2023-安全驾驶辅助驾驶员状态监测DMS和限速辅助测试流程-中文版
From VLAN to IPVLAN: Talking about virtual network devices and their cloud-native applications
【 IDEA 】关闭右侧代码缩略图
PCB做SET连片,转批量时发现利用率非常低,有遇到过吗?
从 VLAN 到 IPVLAN: 聊聊虚拟网络设备及其在云原生中的应用
Redis 基础
PyTorch框架构建花朵图像分类模型(Resnet网络,迁移学习)
详解|一级建造师考试报名流程有哪些?
华为设备用户接入与认证配置命令
一周精彩内容分享(第15期)
GET请求
深度学习之基础知识
Using the interface address pool for direct networking segment allocation
PreScan Quick Start to Master the Path Tracing of the Driver Model in Lecture 22
codesys file读写配置参数程序
Sketch91: How to set an aligned reference object and align it according to the specified element tutorial