way to set shell used for remote commands?

Christian Weisgerber naddy at mips.inka.de
Thu Jan 22 04:19:02 AEDT 2015


On 2015-01-21, Jason Vas Dias <jason.vas.dias at gmail.com> wrote:

> Please can OpenSSH provide some way of specifying which shell to use to
> execute commands on a host.

No way.  The security fallout is staggering.

> For the account I need to use,  the user's password shell is not acceptable,
> (a ten year old version of bash 3.0)
> and cannot be changed without weeks or months of burocracy , if at all.

Oh, but you could install a new sshd there?

> I built & installed the latest bash under that account, in the ~/bin directory,
> but SSH will not use it.

---- ~/.profile --->
case $BASH_VERSION in
	3.*) exec ~/bin/bash -l ;;
esac
<-------------------

You can build something similar with ~/.bashrc for non-login shells.

> Using the client OpenSSH version : 1:6.6p1-2ubuntu2 on a linux x86_64
> Ubuntu 14.04.1 host,
> if I try to specify which bash to use for an  SSH command like :
>  $ ssh $account /home/${user}/bin/bash -c 'echo $BASH_VERSION; echo
> $BASH_VERSION';
> something very weird happens - only the second statement produces any
> output .

Insufficient quoting.
$ ssh $account "/home/${user}/bin/bash -c 'echo \$BASH_VERSION; echo \$BASH_VERSION'"

-- 
Christian "naddy" Weisgerber                          naddy at mips.inka.de


More information about the openssh-unix-dev mailing list