RE: SSH wont execute commands with bash
- From: "Shafto, Eric" <Eric.Shafto@xxxxxxxx>
- Date: Wed, 15 Nov 2006 13:16:25 -0500
You might try adding the -t argument to your ssh call.
-----Original Message-----
From: listbounce@xxxxxxxxxxxxxxxxx [mailto:listbounce@xxxxxxxxxxxxxxxxx] On Behalf Of Tonnerre Lombard
Sent: Wednesday, November 15, 2006 10:31 AM
To: davej
Cc: secureshell@xxxxxxxxxxxxxxxxx
Subject: Re: SSH wont execute commands with bash
Salut,
On Tue, 2006-11-14 at 05:02 -0800, davej wrote:
------------------------------------
if [ -e /usr/bin/bash ]
exec /usr/bin/bash
exit
fi
------------------------------------
Two notes here:
1. you're not passing on any arguments. These lines should look rather like this:
if [ -e /usr/bin/bash ]
then
exec /usr/bin/bash "$@"
fi
2. exec already overwrites the process so exit is only going to be reached in case of error, in which it might be better to return an error or whatever:
if [ -e /usr/bin/bash ]
then
exec /usr/bin/bash "$@"
ret=$?
echo "Failed to execute bash: ${ret}"
exit ${ret}
fi
Tonnerre
--
SyGroup GmbH
Tonnerre Lombard
Lösungen mit System
Tel:+41 61 333 80 33 Röschenzerstrasse 9
Fax:+41 61 383 14 67 4153 Reinach BL
Web:www.sygroup.ch tonnerre.lombard@xxxxxxxxxx
- Prev by Date: Re: Scp & sftp with no shell access or restricted access
- Next by Date: IPv6 Link-Local SSH connections
- Previous by thread: Re: SSH wont execute commands with bash
- Next by thread: User at host
- Index(es):
Relevant Pages
|