- 生成ssh密钥:
ssh-keygen -t rsa -C "shelldawn@where.com"
- 配置config:
位置:~/.ssh/config,没有则新建一个
Host haha // 快速登陆的代替名字
HostName 127.0.0.1
User shelldawn
IdentityFile ~/.ssh/id_rsa
- 上传私钥:
ssh-copy-id -i ~/.ssh/id_rsa shelldawn@127.0.0.1
输入服务端密码后结束。
- 从此可以免密码快速登陆服务器
ssh haha

本文详细介绍如何通过生成SSH密钥、配置config文件及上传私钥实现免密码快速登录服务器的过程,适合初学者掌握SSH的基本操作。
1050

被折叠的 条评论
为什么被折叠?



