- 生成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