Ethical Hacking

Learn to find vulnerabilities before the bad guys do! Gain real world hands on hacking experience in our state of the art hacking lab. Course designed and taught by expert instructors with years of penetration testing experience. 12 student maximum in every class. Certification attempt included in every package.
Computer Forensics Training at InfoSec Institute

Gain the in-demand skills of a certified computer examiner, learn to recover trace data left behind by fraud, theft, and cybercrime perpetrators. Discover the source of computer crime and abuse at your organization so that it never happens again. All of our class sizes are guaranteed to be 12 students or less to facilitate one-on-one interaction with one of our expert instructors.




Network Security Secure-Shell
[Top] [All Lists]

Re: SSH wont execute commands with bash

Subject: Re: SSH wont execute commands with bash
Date: Wed, 15 Nov 2006 08:30:27 +0100
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@sygroup.ch

Attachment: signature.asc
Description: This is a digitally signed message part

<Prev in Thread] Current Thread [Next in Thread>