<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Where is Path set for SU? in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/where-is-path-set-for-su/m-p/2458900#M13401</link>
    <description>Greg:&lt;BR /&gt;&lt;BR /&gt;From the man page for 'su':&lt;BR /&gt;&lt;BR /&gt;If you specify the - option of the su command, the new shell starts up as if you just logged in, except as follows:&lt;BR /&gt;&lt;BR /&gt;+ The HOME variable is reset to the new user's home directory.&lt;BR /&gt;&lt;BR /&gt;+ If the new user name is root, the path and prompt variables are reset:&lt;BR /&gt;                 PATH=/usr/bin:/usr/sbin:/sbin&lt;BR /&gt;PS1=#&lt;BR /&gt;&lt;BR /&gt;Does this help?&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
    <pubDate>Fri, 27 Oct 2000 17:06:35 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2000-10-27T17:06:35Z</dc:date>
    <item>
      <title>Where is Path set for SU?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/where-is-path-set-for-su/m-p/2458899#M13400</link>
      <description>Dumb question but where is PATH set for SU?   I would think it's /.profile but none of the Paths set in it are being set for SU , just get PATH=/usr/sbin:/usr/bin.   We automount common files like usr/local for all machines from one disk plus alot of others files.    Any way to find where Path is set for SU??</description>
      <pubDate>Fri, 27 Oct 2000 16:59:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/where-is-path-set-for-su/m-p/2458899#M13400</guid>
      <dc:creator>Greg Roberts</dc:creator>
      <dc:date>2000-10-27T16:59:41Z</dc:date>
    </item>
    <item>
      <title>Re: Where is Path set for SU?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/where-is-path-set-for-su/m-p/2458900#M13401</link>
      <description>Greg:&lt;BR /&gt;&lt;BR /&gt;From the man page for 'su':&lt;BR /&gt;&lt;BR /&gt;If you specify the - option of the su command, the new shell starts up as if you just logged in, except as follows:&lt;BR /&gt;&lt;BR /&gt;+ The HOME variable is reset to the new user's home directory.&lt;BR /&gt;&lt;BR /&gt;+ If the new user name is root, the path and prompt variables are reset:&lt;BR /&gt;                 PATH=/usr/bin:/usr/sbin:/sbin&lt;BR /&gt;PS1=#&lt;BR /&gt;&lt;BR /&gt;Does this help?&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 27 Oct 2000 17:06:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/where-is-path-set-for-su/m-p/2458900#M13401</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2000-10-27T17:06:35Z</dc:date>
    </item>
    <item>
      <title>Re: Where is Path set for SU?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/where-is-path-set-for-su/m-p/2458901#M13402</link>
      <description>OK, is there an easy why to override the default PATH for su besides exporting a path?</description>
      <pubDate>Fri, 27 Oct 2000 17:13:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/where-is-path-set-for-su/m-p/2458901#M13402</guid>
      <dc:creator>Greg Roberts</dc:creator>
      <dc:date>2000-10-27T17:13:50Z</dc:date>
    </item>
    <item>
      <title>Re: Where is Path set for SU?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/where-is-path-set-for-su/m-p/2458902#M13403</link>
      <description>Greg:&lt;BR /&gt;There are two types of commands, 1)Internal and 2) External&lt;BR /&gt;Internal commands : Itnernal commands are commands which are known to the shell and are part of the shell. &lt;BR /&gt;External commands : These commands require an external file (Executables/shellscripts etc.,) to be present at some directory.&lt;BR /&gt;Now the question comes how does shell know where it is located ?&lt;BR /&gt;The answer is PATH variable. &lt;BR /&gt;&lt;BR /&gt;When it comes to path, generally it will be set in global /etc/profile or /home/greg/.profile, The order of execution of these profiles is /etc/profile -&amp;gt; /home/greg/.profie. &lt;BR /&gt;&lt;BR /&gt;Generally, if path is not set and you fire the command, shell says 'not found'. If you want to find out exactly where a partiuclar executable is located, you can use&lt;BR /&gt;&lt;BR /&gt;# whereis &lt;COMMAND&gt;&lt;BR /&gt;The output of above command will be the path where the executable is located. &lt;BR /&gt;&lt;BR /&gt;or the find command can be used. &lt;BR /&gt;# find / -name &lt;THE-FILE name=""&gt; 2&amp;gt;/dev/null -print.&lt;BR /&gt;&lt;BR /&gt;Regarding su command it is located at /usr/bin/su.&lt;BR /&gt;&lt;BR /&gt;Regards, &lt;BR /&gt;......Madhu&lt;BR /&gt;&lt;BR /&gt;&lt;/THE-FILE&gt;&lt;/COMMAND&gt;</description>
      <pubDate>Fri, 27 Oct 2000 17:15:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/where-is-path-set-for-su/m-p/2458902#M13403</guid>
      <dc:creator>Madhu Sudhan_1</dc:creator>
      <dc:date>2000-10-27T17:15:07Z</dc:date>
    </item>
    <item>
      <title>Re: Where is Path set for SU?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/where-is-path-set-for-su/m-p/2458903#M13404</link>
      <description>Greg:&lt;BR /&gt;&lt;BR /&gt;I think you want to 'su' without the '-' flag.  Try this:&lt;BR /&gt;&lt;BR /&gt;# echo $PATH&lt;BR /&gt;# PATH=$PATH:/tmp #...add /tmp to PATH&lt;BR /&gt;# su someuser&lt;BR /&gt;# echo $PATH&lt;BR /&gt;# exit # back to original&lt;BR /&gt;# su - someuser&lt;BR /&gt;# echo $PATH&lt;BR /&gt;# exit&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 27 Oct 2000 17:29:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/where-is-path-set-for-su/m-p/2458903#M13404</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2000-10-27T17:29:39Z</dc:date>
    </item>
    <item>
      <title>Re: Where is Path set for SU?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/where-is-path-set-for-su/m-p/2458904#M13405</link>
      <description>A really big CAUTION: never use su without the - sign! It is one of the classic security hacks in Unix.  When you use su without the -, ESPECIALLY su with no toptions, you are not in the new user environment. This is especially critical for root becuase not only is $PATH not set according to root's rules, but many other variables, aliases, things that root admins get used to are not setup.&lt;BR /&gt;&lt;BR /&gt;The same is true for some like root doing an su to oracle.  The oracle user may have all sorts of customized tasks and settings run by .profile but they won't be touched without using the - option as in: &lt;BR /&gt;&lt;BR /&gt;/usr/bin/su - oracle&lt;BR /&gt;&lt;BR /&gt;Notice that I did NOT type su?  Where did your copy of su come from?  Since su without any directory will wander through the $PATH values, it could be /usr/local/bin/su or even /tmp/su, programs put there specifically by a hacker.  To see where su will come from, use the whence -v command (ksh, POSIX sh) as in:&lt;BR /&gt;&lt;BR /&gt;whence -v su&lt;BR /&gt;&lt;BR /&gt;So the default $PATH for su is the hacker's environment--except for root where su tries to keep you from getting in trouble.  So, to avoid big problems, never type su without the - sign.</description>
      <pubDate>Fri, 27 Oct 2000 19:00:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/where-is-path-set-for-su/m-p/2458904#M13405</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2000-10-27T19:00:01Z</dc:date>
    </item>
    <item>
      <title>Re: Where is Path set for SU?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/where-is-path-set-for-su/m-p/2458905#M13406</link>
      <description>Bill:&lt;BR /&gt;&lt;BR /&gt;Thanks for the cautionary note!  A really good point!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 27 Oct 2000 19:10:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/where-is-path-set-for-su/m-p/2458905#M13406</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2000-10-27T19:10:10Z</dc:date>
    </item>
  </channel>
</rss>

