Professional Web Applications Themes

$PATH for regular user - Linux / Unix Administration

The PATH in /etc/default/login is # PATH sets the initial shell PATH variable # #PATH=/usr/bin: the ~/.profile for regular user has PATH=$PATH:/usr/ucb:. but "echo $PATH" shows /usr/bin:/bin:/usr/sbin:/sbin:/usr/ucb:. (I am expecting /usr/bin:/usr/ucb:.) I uncomment #PATH=/usr/bin: and it does not make any difference. Anything put in PATH of /etc/default/login is totally ignored. /usr/bin/login is supposed to read this file, right? 1)What happened? 2) Where do /usr/bin:/bin:/usr/sbin:/sbin come from? (finally, I have to use PATH=/usr/bin:/usr/ucb:. in ~/.profile to reach the goal). This just happens to regular user. root is ok. Thanks for your explanation! Victor...

  1. #1

    Default $PATH for regular user

    The PATH in /etc/default/login is
    # PATH sets the initial shell PATH variable
    #
    #PATH=/usr/bin:

    the ~/.profile for regular user has
    PATH=$PATH:/usr/ucb:.

    but "echo $PATH" shows
    /usr/bin:/bin:/usr/sbin:/sbin:/usr/ucb:. (I am expecting
    /usr/bin:/usr/ucb:.)

    I uncomment #PATH=/usr/bin: and it does not make any difference.
    Anything put in PATH of /etc/default/login is totally ignored.
    /usr/bin/login is supposed to read this file, right? 1)What happened?

    2) Where do /usr/bin:/bin:/usr/sbin:/sbin come from?

    (finally, I have to use PATH=/usr/bin:/usr/ucb:. in ~/.profile to reach
    the goal).

    This just happens to regular user. root is ok.

    Thanks for your explanation!

    Victor

    victorfeng1973@yahoo.com Guest

  2. #2

    Default Re: $PATH for regular user

    Have a look in /etc/profile... This is a somewhat disturbing UNIX
    behaviour and is depending
    on which shell you're using.

    Thommy Guest

  3. #3

    Default Re: $PATH for regular user

    It is bash shell in Solaris 9

    usernamemachine> more /etc/profile
    #ident "(#)profile 1.19 01/03/13 SMI" /* SVr4.0 1.3 */

    # The profile that all logins get before using their own .profile.

    trap "" 2 3

    # change on 12-15-2005
    .. /etc/profile_share
    export LOGNAME

    if [ "$TERM" = "" ]
    then
    if /bin/i386
    then
    TERM=sun-color
    else
    TERM=sun
    fi
    export TERM
    fi

    # Login and -su shells get /etc/profile services.
    # -rsh is given its environment in its .profile.

    case "$0" in
    -sh | -ksh | -jsh | -bash)

    if [ ! -f .hushlogin ]
    then
    /usr/sbin/quota
    # Allow the user to break the Message-Of-The-Day
    only.
    trap "trap '' 2" 2
    /bin/cat -s /etc/motd
    trap "" 2

    /bin/mail -E
    case $? in
    0)
    echo "You have new mail."
    ;;
    2)
    echo "You have mail."
    ;;
    esac
    fi
    esac

    umask 022
    trap 2 3
    usernamemachine>
    usernamemachine> more /etc/profile_share
    # this file is used in /etc/profile. Changes will affect every user
    including root.

    if [ "$MANPATH" = "" ]
    then
    MANPATH=/usr/share/man
    else
    MANPATH=$MANPATH:/usr/share/man
    fi
    MANPATH=$MANPATH:/usr/dt/share/man
    MANPATH=$MANPATH:/usr/openwin/share/man
    MANPATH=$MANPATH:/usr/sfw/share/man
    MANPATH=$MANPATH:/usr/sfw/esp/man
    MANPATH=$MANPATH:/usr/perl5/5.6.1/man
    MANPATH=$MANPATH:/usr/j2se/man
    MANPATH=$MANPATH:/usr/apache/man
    MANPATH=$MANPATH:/opt/SUNWppro/man
    MANPATH=$MANPATH:/opt/sfw/man

    EDITOR=vi
    export MANPATH EDITOR

    Victor

    victorfeng1973@yahoo.com Guest

  4. #4

    Default Re: $PATH for regular user

    When user logins through ssh, most of parameters in /etc/default/login
    will not take effect if they are changed e.g. PATH and RETRIES. The
    shell will use the default value. Exception: PATH default value for
    ssh is /usr/bin:/bin:/usr/sbin:/sbin:,

    If user logins through telnet and console, most of parameters in
    /etc/default/login will take effect.

    tricky on ssh?

    Victor

    victorfeng1973@yahoo.com Guest

Similar Threads

  1. Convert text path back to regular path
    By greg_humphrey@adobeforums.com in forum Adobe Illustrator Macintosh
    Replies: 2
    Last Post: August 9th, 12:07 PM
  2. How to set the path for user root
    By Unix in forum Linux / Unix Administration
    Replies: 5
    Last Post: May 18th, 07:53 PM
  3. Validating user-input to be inserted in regular expressions
    By Vincenzo Ciancia in forum PostgreSQL / PGSQL
    Replies: 4
    Last Post: January 25th, 06:16 PM
  4. acrodist.exe not launching as regular user
    By Joyce_Nord@adobeforums.com in forum Adobe Acrobat Windows
    Replies: 3
    Last Post: April 29th, 06:03 PM
  5. regular user's command being owned by root
    By Steven in forum Sun Solaris
    Replies: 14
    Last Post: August 8th, 05:09 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139