缓存ssh密钥

背景

使用ansible时,为了避免每次执行任务都需要输入ssh密码,我们可以缓存ssh密钥。

ansible 缓存ssh密钥

  1. 启动 ssh-agent 后台程序

eval “$(ssh-agent -s)”

  1. 将密钥添加至 ssh-add,只输入一次密码

ssh-add ~/.ssh/xxx

  1. 验证密钥是否缓存成功

ssh-add -l

Licensed under CC BY-NC-SA 4.0

Powered by Hugo | Theme by Stack
Deployed with GitHub Actions 🚀
使用 Hugo 构建
主题 StackJimmy 设计