SUMMARY: how to set correct path?

From: Gérard Henry (ghenry@cmi.univ-mrs.fr)
Date: Sat Apr 09 2005 - 06:08:23 EDT


sorry for this late summary, not in my lab during last week
thanks to everybody answering my question:
Eric Lewandowski
alexei
Ryan Krenzischeck
David Foster
Michael Schulte
Matthew Stier
Bill Williams

first, i apologize because my question contains mistake:
if /etc/default/login contains correct PATH, this PATH is correctly use
ven if we login with ssh. My mystake was to ssh root@serv, then su -
<login>, and i forgot that is SUPATH being used

but many interesting things in all responses (except d. foster which
says: man ssh, thanks!)

some people suggest to use openssh instead of sun ssh, it's not my
choice. Finally, /etc/default/login seems a good choice to me, except
for env var as MANPATH, so i need to have a mechanism to give correct
MANPATH to allusers, so i continue to use something like:
in ${HOME}/.cshrc
source /modele/Cshrc

and /modele/Cshrc contains everything user needs.

Here is responses i received:
-----------------------------------------------------------------------
Eric Lewandowski

You may want to try setting UseLogin=yes in your sshd_config file and
restart SSHD or if its running from inetd, kill -HUP <PID of inetd>.

-----------------------------------------------------------------------
alexei
For BASH login shell, place the system wide ENV variables, such as PATH,
in /etc/profile

For csh/tcsh login shells, place them in
/etc/csh.cshrc

It is generic for csh/tcsh on any Unix OS.
If /etc/csh.cshrc doesn't exist, then just create it.

I have all the ENV settings in /etc/csh.cshrc on my Solaris 8, 9; Linux
Debian and Redhat systems.

You may also check on /etc/csh.login,
but it is only executed once at login, then the settings are overwritten
by those in /etc/csh.cshrc

-----------------------------------------------------------------------
Ryan Krenzischeck
Because the /etc/default/login only gets sourced when /bin/login is
used. You can set Use_login in the sshd_config to yes and restart sshd.

There was some security issue a while back that I can't remember about
using UseLogin. I'd check google out first.

> thanks, but there is nothing about UseLogin in sshd_config according
> to man ssd_config in solaris 9 (sun ssh)

Hmmm, your right. Apparently sun feels that:

strings sshd |grep -i uselogin
uselogin
%s line %d: "UseLogin" option is obsolete.

Which means, go get the OpenSSH and OpenSSL packages. Sun really does
some crazy crap to open sourced software. No wonder I de-install their
versions and install vanilla versions.

-----------------------------------------------------------------------
David Foster
man ssh

-----------------------------------------------------------------------
Michael Schulte
You can also set the path in /etc/.login, which is executed first by all
    csh login shells (and it works for me when I login with ssh and have the
    login shell csh).
-----------------------------------------------------------------------

Bill Williams
   SSHd has the default/beginning PATH compiled in as added security
feature, and that's what you get when you login with SSH. (SSHd does
NOT refer to the /etc/default stuff defined for the normal 'login'.)

You will need to provide additional PATH stuff through a profile of
some kind. (Possibly /etc/profile)
For example: I have an account I use for development, testing, etc.
that I have setup to use 'bash' as its default shell; it gets all the
extras I want with profiles ~/.bash...

-----------------------------------------------------------------------
Gerard Henry wrote:
> hello all,
> i want to set path for all users in /etc/default/login (solaris 9)
> # ALTSHELL determines if the SHELL environment variable should be set
> #
> ALTSHELL=YES
>
> # PATH sets the initial shell PATH variable
> #
> PATH=/usr/bin:/usr/sbin:/usr/openwin/bin:/usr/openwin/demo:/opt/csw/mysql4/bin:/
>
> usr/sfw/bin:/usr/ccs/bin:/usr/ucb:/opt/SUNWspro/bin:/opt/csw/bin:/usr/local/bin:
>
> /opt/sfw/bin
>
>
> it's okay when user log in with dtlogin, but if i connect with ssh, PATH
> have not the same value:
> echo $PATH
> /usr/bin:/bin:/usr/sbin:/sbin
>
>
> is it a normal feature? what's the best way to set path, avoiding
> something as source /modele/Cshrc in .cshrc?
>
> thanks in advance,
>
> gerard
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:30:31 EDT