Class: Microsandbox::SshServer

Inherits:
Object
  • Object
show all
Defined in:
lib/microsandbox/ssh.rb

Overview

A reusable SSH server endpoint for a sandbox, from Microsandbox::SshOps#prepare_server. Each #serve_connection serves a single SSH transport over this process’s stdin/stdout — typically wired up by a parent SSH daemon via ‘ForceCommand` or an inetd-style spawn. Mirrors the `SshServer` of the official SDKs.

Instance Method Summary collapse

Constructor Details

#initialize(native) ⇒ SshServer

Returns a new instance of SshServer.



186
187
188
# File 'lib/microsandbox/ssh.rb', line 186

def initialize(native)
  @native = native
end

Instance Method Details

#closenil

Release the prepared server endpoint. Idempotent.

Returns:

  • (nil)


200
201
202
203
# File 'lib/microsandbox/ssh.rb', line 200

def close
  @native.close
  nil
end

#serve_connectionnil

Serve one SSH connection over this process’s stdin/stdout. Blocks until the session ends.

Returns:

  • (nil)


193
194
195
196
# File 'lib/microsandbox/ssh.rb', line 193

def serve_connection
  @native.serve_connection
  nil
end