in reply to Re: Problem executing command via ssh
in thread Problem executing command via ssh

Doing: ssh user@remotehost.com /bin/sh does not get me /bin/sh, but the default shell for the corresponding user. Am I missing something? Thanks!
  • Comment on Re^2: Problem executing command via ssh

Replies are listed 'Best First'.
Re^3: Problem executing command via ssh
by jcb (Parson) on Aug 25, 2019 at 23:55 UTC

    It is possible that /bin/sh may be a special case in newer versions of the SSH server or you have some other configuration acting as a "safety net" in your case. I still would not recommend depending on this; you should be using the "forced command" option on the public key to ensure that it can only be used to run your program and you still need to read perlsec and make sure that your program cannot be exploited into a shell-equivalent if this is an actual security issue.