| Summary: | Launching remote command fails if command must be set in initial request | ||
|---|---|---|---|
| Product: | [Tools] Target Management | Reporter: | Rob Stryker <stryker> |
| Component: | RSE | Assignee: | dsdp.tm.rse-inbox <tm.rse-inbox> |
| Status: | NEW --- | QA Contact: | Martin Oberhuber <mober.at+eclipse> |
| Severity: | major | ||
| Priority: | P3 | ||
| Version: | 3.2.2 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
Given a remote server with the following characteristics: 1) Rejects ssh connections with no attached command 2) Rejects ssh connections if the attached command is not an approved command From the CLI, the following commands give the following output: 1) Command: ssh user@host Output: Connections require an approved command 2) Command: ssh user@host 'ls' Output: Invalid command ls 3) Command: ssh user@host 'tail folder/i/own/*' Output: (expected output, tail of files, etc) When using RSE, the server's response is always the one from example 1... as if an initial command is not set when connecting to the host. My first attempt to fix it involved drilling down into IShellService.runCommand(etc). It is there revealed that the code in TerminalShellService.runCommand(etc) includes the following: ITerminalShell terminalShell = fTerminalService.launchTerminal("vt100", encoding, environment, initialWorkingDirectory, null, monitor); TerminalServiceHostShell hostShell = new TerminalServiceHostShell( terminalShell, initialWorkingDirectory, command, environment); IT is clear here that the first command to launch the ITerminalShell passes null in as the command. It clearly tries to create a terminal with no command, then create a shell out of it. This would explain the rejection by the server, as the server will reject all ssh connections with no command. In my own code, I attempted the following: SshTerminalService sshTerminalService = (SshTerminalService)terminalService; tshell = new SshTerminalShell(sshTerminalService.getSessionProvider(), "vt100", null, new String[]{}, null, command); This is to force the command to be passed into the first shell command. However, even in this situation, the remote host still replies with "Connections require an approved command", the output from use-case 1. I am left with no way to simulate ssh user@host 'tail *.txt', or something similar. Any ideas?