diff --git a/classes/connection.py b/classes/connection.py index fe43239..55d61b8 100644 --- a/classes/connection.py +++ b/classes/connection.py @@ -24,7 +24,7 @@ class Connection: self._client = SSHClient() self._client.load_system_host_keys() self._client.set_missing_host_key_policy(WarningPolicy) - self._client.connect(vessel.address, vessel.username, + self._client.connect(vessel.address, vessel.port, vessel.username, vessel.password, passphrase=vessel.passphrase) self._transport = self._client.get_transport() self._transport.set_keepalive(10) diff --git a/classes/vessel.py b/classes/vessel.py index d7bb3d4..81d5e88 100644 --- a/classes/vessel.py +++ b/classes/vessel.py @@ -33,6 +33,7 @@ class Vessel: username = None password = None passphrase = None + port = 22 if "TempDir" in config.keys(): tempdir = config["TempDir"] @@ -46,6 +47,9 @@ class Vessel: if "Passphrase" in config.keys(): passphrase = config["Passphrase"] + if "Port" in config.keys(): + port = config["Port"] + if "Address" in config.keys(): return cls(config.name.split()[1], config["Address"], username, password, passphrase, tempdir) @@ -55,7 +59,7 @@ class Vessel: def __init__(self, name: str, address: str, username: Optional[str] = None, password: Optional[str] = None, passphrase: Optional[str] = None, - tempdir: Optional[Union[str, pathlib.Path]] = None) -> None: + port: Optional[int] = None, tempdir: Optional[Union[str, pathlib.Path]] = None) -> None: """Initialize new Vessel object Args: @@ -70,6 +74,7 @@ class Vessel: self.username = username self.password = password self.passphrase = passphrase + self.port = port or 22 self._connection = None self._uploaded = self.getUploadedFromDB() # Files already uploaded