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

Bob Proulx bob at proulx.com
Sun Sep 17 13:37:25 EST 2006

SSH, like RSH before it, invokes a command using the user's shell as
specified in the passwd file.  In a mixed shell environment with some
logins csh-like and some sh-like that is sometimes very difficult to
handle.  (No, I am not fond of csh.)  If I could force a single shell
everywhere of course that would be preferable but sometimes I have no
control over it.

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.

Is there any possibility of getting an option added to ssh such that
it will use a standard shell on all platforms regardless of the user's
configured shell?

  ssh -oCommandShell=/bin/sh example.com "my command here"

But maybe there is already a way to do this and I just have not been
able to figure it out?  This problem finally caused me enough trouble
that I decided I would need to ask for help.


Bob Proulx <bob at proulx.com>
openssh-unix-dev mailing list
openssh-unix-dev at mindrot.org

More information about the openssh-unix-dev mailing list