1.生成公钥和私钥
ssh-keygen等同于ssh-keygen -t rsa
运行上面的命令后,系统会出现一系列提示,可以一路回车,例如:
$ ssh-keygen Generating public/private rsa key pair.Enter file in which to save the key (/home/glowd/.ssh/id_rsa): Enter特别说明,要不要对私钥设置口令(passphrase),如果担心私钥的安全,可以设置一个。没有特殊需求直接Enter,为空
运行结束以后, 默认在 ~/.ssh目录生成两个文件:
id_rsa :私钥
id_rsa.pub :公钥
2.导入公钥到认证文件,更改权限
- 导入本机
cat ~/.ssh/id_rsa.pub >> ~/.ssh/autho 继续阅读与本文标签相同的文章
上一篇 :
nignx启动80端口一直占用
-
spring中Aware结尾接口(5)
2026-05-23栏目: 教程
-
Spring 框架文档之 Spring 框架概述
2026-05-23栏目: 教程
-
spring bean的生命周期(4)
2026-05-23栏目: 教程
-
spring bean的形式(3)
2026-05-23栏目: 教程
-
demo演示如何写一个无配置格式统一的日志
2026-05-23栏目: 教程
