ssh direct into remote docker container works!
This commit is contained in:
parent
49a530ba57
commit
1eb2cd9c5c
@ -505,9 +505,9 @@ void interactive_ssh(const std::string & server_name, const std::string & comman
|
||||
|
||||
// Execute ssh with server_name and command
|
||||
if (command.empty())
|
||||
execlp("ssh", "ssh", login.c_str(), "-p", ssh_port.c_str(), nullptr);
|
||||
execlp("ssh", "ssh", "-tt", login.c_str(), "-p", ssh_port.c_str(), nullptr);
|
||||
else
|
||||
execlp("ssh", "ssh", login.c_str(), "-p", ssh_port.c_str(), command.c_str(), nullptr);
|
||||
execlp("ssh", "ssh", "-tt", login.c_str(), "-p", ssh_port.c_str(), command.c_str(), nullptr);
|
||||
|
||||
// If exec returns, it means there was an error
|
||||
perror("ssh execution failed");
|
||||
@ -522,7 +522,7 @@ void service_runner::interactive_ssh_service()
|
||||
return;
|
||||
}
|
||||
|
||||
std::string command = construct_standard_command_run_cmd("ssh");
|
||||
std::string command = "/bin/bash -c 'docker exec -it " + m_service_info.service_name + " /bin/bash'";
|
||||
interactive_ssh(m_server_name, command);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user