ssh配置免密登录服务器

1. Windows客户机生成.pub文件

bash 复制代码
# Windows
ssh-keygen -t rsa
# <username>/.ssh/*.pub

2. 复制pub文件到服务器

bash 复制代码
# Windows
# 假设远程主机名为example.com,用户名为user
scp id_rsa.pub <user>@<example.com>:~/

3. 服务器将.pub文件标记为authorized_keys

bash 复制代码
# Linux
cat ~/id_rsa.pub >> ~/.ssh/authorized_keys

4. Windows配置.ssh\config文件, 示例, 具体项目自己改

bash 复制代码
HostName <ip addr or domain name, 111.10.111.10>
Port <22> # default port
User <root> # Your username
IdentitiesOnly yes

5. 测试连接,你试试看

bash 复制代码
# windows
ssh root
相关推荐
Hiyajo pray43 分钟前
SDN 访问控制性能调优方法
服务器·网络·网络安全
huainingning2 小时前
交换机通过ftp下载文件或者传输文件到ftp服务器
运维·服务器·网络
edwarddamon2 小时前
CentOS 7 国内安装 Docker CE(阿里云源)
运维
Championship.23.243 小时前
Linux 3.0 LVDS驱动开发详解
linux·运维·驱动开发·lvds
小池先生3 小时前
Windows服务器如何备份
运维·服务器
风向决定发型丶4 小时前
Shell中的特殊变量
linux·运维·bash
FII工业富联科技服务4 小时前
灯塔工厂用例详解:AR 远程巡检与智能运维闭环落地实践
运维·ar
运维大师4 小时前
【Linux运维极简教程】05-软件包管理
linux·运维·服务器
sramdram5 小时前
数字温度传感器应用于服务器系统热管理方案的优势
服务器·温度传感器·数字温度传感器
hehelm5 小时前
IO 多路复用 — Reactor
linux·服务器·网络·数据库·c++