Module: Rex::Proto::Ssh::ServerClient

Defined in:
lib/rex/proto/ssh/server.rb

Overview

Runtime extension of the SSH clients that connect to the server.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#connectionObject (readonly)

Returns the value of attribute connection


31
32
33
# File 'lib/rex/proto/ssh/server.rb', line 31

def connection
  @connection
end

#serverObject (readonly)

Returns the value of attribute server


31
32
33
# File 'lib/rex/proto/ssh/server.rb', line 31

def server
  @server
end

Instance Method Details

#closeObject


26
27
28
29
# File 'lib/rex/proto/ssh/server.rb', line 26

def close
  @connection_thread.kill if @connection_thread and @connection_thread.alive?
  super
end

#init_cli(server, do_not_start = false) ⇒ Object

Initialize a new connection instance.


16
17
18
19
20
21
22
23
24
# File 'lib/rex/proto/ssh/server.rb', line 16

def init_cli(server, do_not_start = false)
  @server          = server
  @connection      = Rex::Proto::Ssh::Connection.new(
    self, server.server_options.merge(ssh_server: server), server.context
  )
  @connection_thread = Rex::ThreadFactory.spawn("SshConnectionMonitor-#{self}", false) {
    self.connection.start
  } unless do_not_start
end