Class: Synco::Shells::SSH
- Inherits:
-
Synco::Shell
- Object
- Synco::Shell
- Synco::Shells::SSH
- Defined in:
- lib/synco/shells/ssh.rb
Overview
SSH shell provides access to a remote server using SSH.
Instance Attribute Summary
Attributes inherited from Synco::Shell
Instance Method Summary collapse
- #default_command ⇒ Object
-
#initialize(*command, arguments: [], port: nil, key: nil, user: nil, batch_mode: nil, **options) ⇒ SSH
constructor
A new instance of SSH.
Methods inherited from Synco::Shell
Constructor Details
#initialize(*command, arguments: [], port: nil, key: nil, user: nil, batch_mode: nil, **options) ⇒ SSH
Returns a new instance of SSH.
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/synco/shells/ssh.rb', line 31 def initialize(*command, arguments: [], port: nil, key: nil, user: nil, batch_mode: nil, **) if port arguments << '-p' << port end if key arguments << '-i' << value end if user arguments << '-l' << value end unless batch_mode.nil? arguments << '-o' << "BatchMode=#{batch_mode ? 'yes' : 'no'}" end super end |
Instance Method Details
#default_command ⇒ Object
27 28 29 |
# File 'lib/synco/shells/ssh.rb', line 27 def default_command ['ssh'] end |