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: interactive and login shells: bug or design decision ?

Subject: Re: interactive and login shells: bug or design decision ?
Date: Thu, 24 Mar 2005 07:54:46 -0500
On Wed, Mar 23, 2005 at 05:07:58PM +0100, Cristian Zoicas wrote:
When ssh is started interactively, it starts a login shell, but when it is
started in batch mode (e.g. ssh user@some.site.com command) it runs my
command under an interactive shell.

It doesn't do that for me.  From man bash:

       An interactive shell is one started without  non-option  arguments  and
       without  the  -c  option  whose standard input and output are both con-
       nected to terminals (as determined by isatty(3)), or one  started  with
       the  -i  option.   PS1 is set and $- includes i if bash is interactive,
       allowing a shell script or a startup file to test this state.

And on my system:

imadev:~$ ssh localhost 'echo $-'
wooledg@localhost's password: 
hBc

imadev:~$ ssh localhost 'echo $PS1'
wooledg@localhost's password: 


(That's a blank line after the password prompt.)

The ssh version that I use is OpenSSH_3.6.1p2

OpenSSH 3.9p1 for me, on HP-UX 10.20, with bash 2.05b.

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