diff --git a/src/Commands/Remote/SSHBaseCommand.php b/src/Commands/Remote/SSHBaseCommand.php index af9b58c35..8d1053d4f 100755 --- a/src/Commands/Remote/SSHBaseCommand.php +++ b/src/Commands/Remote/SSHBaseCommand.php @@ -376,7 +376,7 @@ private function getCommandSummary($command_args) */ private function getConnectionString() { - $sftp = $this->environment->sftpConnectionInfo(); + $ssh = $this->environment->sshConnectionInfo(); $command = $this->getConfig()->get('ssh_command'); if ($this->output()->isDebug()) { $command .= ' -vvv'; @@ -387,7 +387,7 @@ private function getConnectionString() } return vsprintf( '%s -T %s@%s -p %s -o "StrictHostKeyChecking=no" -o "AddressFamily inet"', - [$command, $sftp['username'], $this->lookupHostViaAlternateNameserver($sftp['host']), $sftp['port']] + [$command, $ssh['username'], $this->lookupHostViaAlternateNameserver($ssh['host']), $ssh['port']] ); } diff --git a/src/Models/Environment.php b/src/Models/Environment.php index eb20899ee..2111f1fe2 100755 --- a/src/Models/Environment.php +++ b/src/Models/Environment.php @@ -985,9 +985,7 @@ public function setHttpsCertificate($certificate = []) } /** - * Gives SFTP connection info for this environment - * - * @return array + * Gives sftp connection info for this environment. */ public function sftpConnectionInfo() { @@ -995,6 +993,16 @@ public function sftpConnectionInfo() // No SFTP for EVCS sites return []; } + return $this->sshConnectionInfo(); + } + + /** + * Gives ssh connection info for this environment + * + * @return array + */ + public function sshConnectionInfo() + { $site = $this->getSite(); if (!empty($ssh_host = $this->getConfig()->get('ssh_host'))) { $username = "appserver.{$this->id}.{$site->id}";