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

hlxwell · December 16, 2011 · Last by Saito replied at February 04, 2012 · 3107 hits

刚发布。试试挺好的。

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}` }
You need to Sign in before reply, if you don't have an account, please Sign up first.