分享 Cap sshkey man - 部署开发者 public ssh key 到所有的服务器

hlxwell · 2011年12月16日 · 最后由 Saito 回复于 2012年02月04日 · 3107 次阅读

刚发布。试试挺好的。

https://github.com/hlxwell/cap-ssh-key-man

Cap ssh-key man

A capistrano command that allows you to put all developers' public keys to all servers. This must be a painful job to add developer's ssh key to all servers one by one, but after you have this tool, you just need execute cap sshkey:deploy

Usage

  1. Add gem "cap-ssh-key-man" in your Gemfile.

  2. Add require 'cap-ssh-key-man' to config/deploy.rb of your rails project.

  3. Put all public ssh keys to config/developer_ssh_keys dir of your rails project.

  4. Execute cap sshkey:deploy

Done.

Author

Michael He

http://www.tui8.com

http://github.com/hlxwell

不错,貌似少了更改权限的步骤

有道理。

用 ssh agent forward 更安全啊

看错了,是加 pub key

user, machine = 'saito', 'arch'
keydir = '/Users/saito/.ssh/keydir'

keys = Dir.glob File.join(keydir, '*.pub')
keys.each{ |k| `ssh-copy-id -i #{k} #{user}@#{machine}` }
需要 登录 后方可回复, 如果你还没有账号请 注册新账号