Class | Net::SSH::Authentication::Methods::Abstract |
In: |
lib/net/ssh/authentication/methods/abstract.rb
lib/net/ssh/authentication/methods/abstract.rb |
Parent: | Object |
The base class of all user authentication methods. It provides a few bits of common functionality.
key_manager | [R] | The key manager object. Not all authentication methods will require this. |
key_manager | [R] | The key manager object. Not all authentication methods will require this. |
session | [R] | The authentication session object |
session | [R] | The authentication session object |
Sends a message via the underlying transport layer abstraction. This will block until the message is completely sent.
# File lib/net/ssh/authentication/methods/abstract.rb, line 36 36: def send_message(msg) 37: session.transport.send_message(msg) 38: end
Sends a message via the underlying transport layer abstraction. This will block until the message is completely sent.
# File lib/net/ssh/authentication/methods/abstract.rb, line 36 36: def send_message(msg) 37: session.transport.send_message(msg) 38: end
Creates a new USERAUTH_REQUEST packet. The extra arguments on the end must be either boolean values or strings, and are tacked onto the end of the packet. The new packet is returned, ready for sending.
# File lib/net/ssh/authentication/methods/abstract.rb, line 43 43: def userauth_request(username, next_service, auth_method, *others) 44: buffer = Net::SSH::Buffer.from(:byte, USERAUTH_REQUEST, 45: :string, username, :string, next_service, :string, auth_method) 46: 47: others.each do |value| 48: case value 49: when true, false then buffer.write_bool(value) 50: when String then buffer.write_string(value) 51: else raise ArgumentError, "don't know how to write #{value.inspect}" 52: end 53: end 54: 55: buffer 56: end
Creates a new USERAUTH_REQUEST packet. The extra arguments on the end must be either boolean values or strings, and are tacked onto the end of the packet. The new packet is returned, ready for sending.
# File lib/net/ssh/authentication/methods/abstract.rb, line 43 43: def userauth_request(username, next_service, auth_method, *others) 44: buffer = Net::SSH::Buffer.from(:byte, USERAUTH_REQUEST, 45: :string, username, :string, next_service, :string, auth_method) 46: 47: others.each do |value| 48: case value 49: when true, false then buffer.write_bool(value) 50: when String then buffer.write_string(value) 51: else raise ArgumentError, "don't know how to write #{value.inspect}" 52: end 53: end 54: 55: buffer 56: end