Sha256: 381ca6cac4fcef2400b73900191cc38d765525cbb9f44afc3ce3ab56f31b4438

Contents?: true

Size: 437 Bytes

Versions: 13

Compression:

Stored size: 437 Bytes

Contents

Capistrano.configuration(:must_exist).load do

  # set :user, (defined?(user) ? user : ENV['USER'])
  desc "Copies contents of ssh public keys into authorized_keys file"
  task :setup_ssh_keys do
    sudo "test -d ~/.ssh || mkdir ~/.ssh"
    sudo "chmod 0700 ~/.ssh"    
    put(ssh_options[:keys].collect{|key| File.read(key+'.pub')}.join("\n"),
      File.join('/home', user, '.ssh/authorized_keys'),
      :mode => 0600 )
  end
  
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
deprec-1.1.0 lib/deprec/recipes/ssh.rb
deprec-1.2.0 lib/deprec/recipes/ssh.rb
deprec-1.2.1 lib/deprec/recipes/ssh.rb
deprec-1.2.2 lib/deprec/recipes/ssh.rb
deprec-1.2.3 lib/deprec/recipes/ssh.rb
deprec-1.3.0 lib/deprec/recipes/ssh.rb
deprec-1.3.1 lib/deprec/recipes/ssh.rb
deprec-1.4.1 lib/deprec/recipes/ssh.rb
deprec-1.4.2 lib/deprec/recipes/ssh.rb
deprec-1.5.0 lib/deprec/recipes/ssh.rb
deprec-1.5.1 lib/deprec/recipes/ssh.rb
deprec-1.6.0 lib/deprec/recipes/ssh.rb
deprec-1.7.0 lib/deprec/recipes/ssh.rb