in reply to Problem executing command via ssh
As haukex mentioned, you probably should be using a module for the SSH connection. Two recent questions suggest that Net::SSH::Perl might be useful and give both some pitfalls and solutions.
Further, the SSH configuration you describe does not do what you seem to think that it does — the user account that you have created can get a shell with "ssh user@remotehost.com /bin/sh". You need to use the "forced command" option with the public key registered on the remote machine to ensure that that key can only be used to run your program, and you really need to read perlsec if that remote program is written in Perl and make sure that it cannot be abused to gain a shell if you do not want shell access to be available.
Lastly, one big difference between running ssh on a terminal and on pipes is whether SSH sets up a pty on the remote machine by default. Try "ssh -tt user@remotehost.com" instead if you insist on using IPC::Open3 for this.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Problem executing command via ssh
by haukex (Archbishop) on Aug 24, 2019 at 06:53 UTC | |
|
Re^2: Problem executing command via ssh
by mgalindez (Initiate) on Aug 25, 2019 at 13:54 UTC | |
by jcb (Parson) on Aug 25, 2019 at 23:55 UTC |