Default $PATH of rsh (Was Re: What risk is X11Forward to a server?)

Dave Dykstra dwd at
Sat Oct 27 00:35:30 EST 2001

On Fri, Oct 26, 2001 at 01:38:26AM -0400, Brian Harvell wrote:
> On Thu, 25 Oct 2001, Bob Proulx wrote:
> > On AIX, PATH and other variables are set in /etc/environment.  HPUX
> > has /etc/PATH.  Solaris has /etc/default/login.  Hmm... Wish there was
> > a consistent interface to this.  And on none of those systems do I
> > know of an easy way to localize it for ssh since usually those are all
> > read at interative shell startup by /etc/profile and not on
> > non-interactive shell startup when ssh runs.
> >
> Reads /etc/default/login if detected during compile (ie Solaris)

That file is not intended to be environment variables to set in the user's
process, it is intended to be parameters to the login program; it's not
sufficient to just read that file in.  SSH 1.2.27 has a big long
complicated function to read that file that looks for specific variables,
for example:

    1. set $PATH to the $SUPATH value if super user
    2. set the umask to the $UMASK value
    3. set $SHELL if and only if $ALTSHELL is set
    4. set $TZ if $TIMEZONE is set
    5. set the ulimit if $ULIMIT is set

> Reads $sysconfdir/environment all the time if it's there.

session.c is currently reading /etc/environment only on AIX.  I like
Brian's idea to always look for that in $sysconfdir.

- Dave Dykstra

More information about the openssh-unix-dev mailing list