Class: Management::Server::Ssh

Inherits:
Command
  • Object
show all
Includes:
Helper
Defined in:
lib/management/commands/server/ssh.rb

Instance Method Summary collapse

Methods included from Helper

#cloud, #config, #get_address, #get_env, #get_script, #get_server, #get_type, #live_servers, #system_verbose

Methods inherited from Command

all, #arg_list, #call_with, #command_name, #fn, #help_string, inherited, maxlen, #true_arity

Instance Method Details

#run(server_name) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/management/commands/server/ssh.rb', line 11

def run(server_name)
  server = get_server(server_name)

  ssh_key_path = config[:ssh_key_path]
  system_verbose "chmod 0600 #{ssh_key_path}"
  system_verbose "ssh -i #{ssh_key_path} #{config[:root_user]}@#{server.public_ip_address}"
end