Method: CloudFlock::App::Common#generate_keypair

Defined in:
lib/cloudflock/app/common/servers.rb

#generate_keypair(shell) ⇒ Object

Public: Create a temporary ssh key to be used for passwordless access to the destination host.

shell - SSH object logged in to the source host.

Returns a String containing the host’s new ssh public key.



388
389
390
391
392
# File 'lib/cloudflock/app/common/servers.rb', line 388

def generate_keypair(shell)
  shell.as_root("mkdir #{DATA_DIR}")
  shell.as_root("ssh-keygen -b 4096 -q -t rsa -f #{PRIVATE_KEY} -P ''")
  shell.as_root("cat #{PUBLIC_KEY}")
end