Class: Kitsune::Kit::Commands::Ssh

Inherits:
Thor
  • Object
show all
Defined in:
lib/kitsune/kit/commands/ssh.rb

Instance Method Summary collapse

Instance Method Details

#connectObject



16
17
18
19
20
21
22
23
24
25
# File 'lib/kitsune/kit/commands/ssh.rb', line 16

def connect
  Kitsune::Kit::EnvLoader.load!

  ip = options[:ip] || fetch_server_ip
  user = options[:user]
  key_path = Kitsune::Kit::Defaults.ssh[:ssh_key_path]

  say "🔗 Connecting to #{user}@#{ip}...", :green
  exec "ssh -i #{key_path} -o StrictHostKeyChecking=no #{user}@#{ip}"
end