login.conf MAIL environment weirdness solved

mike at hyperreal.org mike at hyperreal.org
Fri Jan 12 15:17:02 EST 2001


A while back, I posted to the freebsd-questions list about a problem I was
having getting custom MAIL environment variable settings in
/etc/login.conf to take. Something had happened between FreeBSD 3.3 and
4.2 that caused MAIL to always be set to /var/mail/$USER. It turns out
this was a problem with the sshd configuration.

The problem was apparently related to the fact OpenSSH's sshd is now
configured by default with "UseLogin no", meaning it will not invoke the
system's login(1) after authentication. I changed this to "UseLogin yes"
and sent a HUP signal to sshd, and all is well; MAIL is now whatever I set
it to in /etc/login.conf (and /etc/login.conf.db).

The version of OpenSSH that comes with FreeBSD 4.2, if "UseLogin no"  is
set or is undefined, will seem to process *other* environment variables
defined in /etc/login.conf, but always leaves MAIL as the default value
which is compiled into sshd. This was very a confusing situation and made
the problem difficult to diagnose. More recent snapshots of OpenSSH do not
seem to acknowledge environment changes in /etc/login.conf at all, when
UseLogin was no.

So like I said, the solution was "UseLogin yes" in sshd_config.
Now I have some questions:

1. What risks are there in having "UseLogin yes"?

2. Is the current sshd behaving as intended (not doing anything to cause
/etc/login.conf.db to be processed at all)?

3. Why was the older version picking up the login.conf environment
settings, aside from MAIL, even if "UseLogin no" was set?

   - Mike
________________________________________________________________________
 Mike Brown / Hyperreal   |   Hyperreal http://music.hyperreal.org/
 PO Box 61334             |   XML & XSL http://skew.org/xml/
 Denver CO 80206-8334 USA |    personal http://www.hyperreal.org/~mike/






More information about the openssh-unix-dev mailing list