SUMMARY: how to set correct path?

From: Gérard Henry (ghenry_at_cmi.univ-mrs.fr)
Date: 04/09/05

  • Next message: John DiMarco: "IMPORTANT: Read this before posting to Sun-Managers"
    Date: Sat, 09 Apr 2005 12:08:23 +0200
    To: sunmanagers@sunmanagers.org
    
    

    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


  • Next message: John DiMarco: "IMPORTANT: Read this before posting to Sun-Managers"

    Relevant Pages

    • Re: Detailed logging of ssh sessions
      ... >via ssh). ... come in some way from the login shell. ... I'd just experiment with using script in some way ...
      (freebsd-questions)
    • Re: Hack attempt, best way to secure?
      ... Chris Mattern wrote: ... sshd login attempts over the last week or so. ... I can still access my system from anywhere as I have a couple of ssh ...
      (comp.security.ssh)
    • Re: SSH timeout settings
      ... My OpenSSH on my Free 4.4 Release box ... If you are using login with ssh, ... Within sshd itself: ... I'd use the sshd_config option and not login, but i don't use login w/ ...
      (FreeBSD-Security)
    • On ssh Login Mechanics
      ... primarily to be used when doing ssh port forwarding. ... "forwarding" has no shell and it exits immediately after any login attempt. ... connection to sshd precedes any login attempt. ...
      (comp.security.ssh)
    • Re: ssh port forwarding - simple question
      ... :> from A to another machine B, and the mail server is on machine C... ... host the POP service, also has sshd demon enabled, right? ... you need to be able to login on that machine. ... I just tried your domain "ssh nextstep.org" and it appears that sshd is ...
      (comp.security.ssh)