.bashrc is not sourced after ssh -t (but is sourced if -t isn't used)

2007-12-04 Thread Vincent Lefevre
The following has been tried on OpenSUSE 10.2 and Mac OS X 10.4.11.

When run by sshd, bash doesn't behave consistently:
  1. bash sources the init files when one uses "ssh  ".
  2. bash doesn't do that when one uses "ssh -t  ".

According to the bash man page, (1) is correct and (2) is incorrect
(sshd is the remote shell daemon nowadays). But according to the
CHANGES and COMPAT files, this is the converse.

Note that Debian doesn't have this problem, probably because
SSH_SOURCE_BASHRC is uncommented (see README.Debian.gz).

Concerning OpenSUSE, I had reported a bug here:

  https://bugzilla.novell.com/show_bug.cgi?id=345570

-- 
Vincent Lefèvre <[EMAIL PROTECTED]> - Web: 
100% accessible validated (X)HTML - Blog: 
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)




Re: .bashrc is not sourced after ssh -t (but is sourced if -t isn't used)

2007-12-04 Thread Chet Ramey
Vincent Lefevre wrote:
> The following has been tried on OpenSUSE 10.2 and Mac OS X 10.4.11.
> 
> When run by sshd, bash doesn't behave consistently:
>   1. bash sources the init files when one uses "ssh  ".
>   2. bash doesn't do that when one uses "ssh -t  ".

Bash does 1 if (and only if) it can detect it's being run with its
stdin connected to a socket.  `ssh -t' intentionally defeats that.
There is other checking that SSH_SOURCE_BASHRC enables: looking for
SSH_CLIENT or SSH2_CLIENT.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
   Live Strong.  No day but today.
Chet Ramey, ITS, CWRU[EMAIL PROTECTED]http://cnswww.cns.cwru.edu/~chet/