wishlist: option to cause /bin/sh to be used instead of user's shell

Daniel Kahn Gillmor dkg-openssh.com at fifthhorseman.net
Sun Sep 17 14:03:19 EST 2006

On September 16, bob at proulx.com said:

> I have often wanted an option that would force ssh to invoke the
> command using /bin/sh regardless of the user's configured shell.  The
> best that I can do right now is to pipe the commands into shell.
>   echo echo some command | ssh example.com /bin/sh
> That works very well when I don't need to also use the stdin for
> something else.  But if I do need stdin for something else then this
> workaround breaks down.

when i have this situation, i often use:

  ssh example.com "/bin/sh -c 'some command'"

which i can pipe stdin to without trouble.  If stdin really needs to
be coming from a pseudoterminal, i use:

  ssh -t example.com "/bin/sh -c 'some command'"

In either case, the quoting can become a little bit hairy if the
command is large, but for simplish commands, it works without much
trouble.  I'm sure someone else can produce a more reasonable quoting



More information about the openssh-unix-dev mailing list