diff --git a/src/server_env.cpp b/src/server_env.cpp index 1eb27fb..dc06c3f 100644 --- a/src/server_env.cpp +++ b/src/server_env.cpp @@ -64,7 +64,7 @@ std::string server_env::get_variable(const std::string& name) const { std::string server_env::construct_ssh_cmd() const { std::stringstream ssh_cmd; ssh_cmd << "ssh -p " << get_SSH_PORT() << " " - << get_SSH_USER() << "@" << get_SSH_HOST() << " "; + << get_SSH_USER() << "@" << get_SSH_HOST(); return ssh_cmd.str(); } @@ -123,7 +123,7 @@ bool server_env::check_remote_items_exist(const std::vector &file_p } bool server_env::execute_ssh_command(const sCommand& command) const { - std::string full_cmd = construct_ssh_cmd() + quote(command.construct_safecmd()); + std::string full_cmd = construct_ssh_cmd() + " " + quote(command.construct_safecmd()); bool okay = execute_local_command(full_cmd); if (!okay) { std::cerr << "Error: Failed to execute command on remote server: " << full_cmd << std::endl; @@ -133,7 +133,7 @@ bool server_env::execute_ssh_command(const sCommand& command) const { bool server_env::execute_ssh_command_and_capture_output(const sCommand& command, std::string &output) const { - std::string full_cmd = construct_ssh_cmd() + quote(command.construct_safecmd()); + std::string full_cmd = construct_ssh_cmd() + " " + quote(command.construct_safecmd()); bool okay = execute_local_command_and_capture_output(full_cmd, output); if (!okay) { std::cerr << "Error: Failed to execute command on remote server: " << full_cmd << std::endl;