<?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: sudo environment settings in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/sudo-environment-settings/m-p/3630886#M237673</link>
    <description>Does the command only run as root?  If it runs as another user you can give him permissions to run:&lt;BR /&gt;&lt;BR /&gt;sudo su - &lt;USER&gt;&lt;BR /&gt;&lt;BR /&gt;By doing the above he would get all environment variables that user normally gets.&lt;BR /&gt;&lt;BR /&gt;Of course you would NOT want to set it up to allow him to do "sudo su - root" (or just "su -" which is the same thing).&lt;BR /&gt;&lt;BR /&gt;Alternatively you could create a wrapper script  that sets the above variables then executes the command and give him sudo access to execute that script.  If you do that make sure the wrapper script is only editable by root so that no one puts a back door in it by adding an "su - " statement to it.&lt;/USER&gt;</description>
    <pubDate>Thu, 22 Sep 2005 08:11:53 GMT</pubDate>
    <dc:creator>Jeff Lightner_1</dc:creator>
    <dc:date>2005-09-22T08:11:53Z</dc:date>
    <item>
      <title>sudo environment settings</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sudo-environment-settings/m-p/3630883#M237670</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I have given sudo permission to a user to restart apache. The user is able to restart apache server but want to set the environment variable before restarting apache.&lt;BR /&gt;&lt;BR /&gt;Is it possible to set the user profile so that when he run 'sudo' command the parameters remain set?&lt;BR /&gt;The parameter he need are :&lt;BR /&gt;export LD_PRELOAD=/usr/lib/lib123&lt;BR /&gt;export SHLIB_PATH=/usr:/usr/lib:/opt/abc/bin:/opt/abc/bin/lib/ext:/opt/abc/cgi-bin&lt;BR /&gt;export AB_LIBRARY_PATH=/opt/abc/cgi-bin&lt;BR /&gt;export ABC_DEFG_DIR=/opt/abc/cgi-bin&lt;BR /&gt;&lt;BR /&gt;Thanks,</description>
      <pubDate>Wed, 21 Sep 2005 01:27:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sudo-environment-settings/m-p/3630883#M237670</guid>
      <dc:creator>Sanjiv Sharma_1</dc:creator>
      <dc:date>2005-09-21T01:27:59Z</dc:date>
    </item>
    <item>
      <title>Re: sudo environment settings</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sudo-environment-settings/m-p/3630884#M237671</link>
      <description>host_name (user_name) "export LD_PRELOAD=/usr/lib/lib123;export SHLIB_PATH=/usr:/usr/lib:/opt/abc/bin:/opt/abc/bin/lib/ext:/opt/abc/cgi-bin;export AB_LIBRARY_PATH=/opt/abc/c&lt;BR /&gt;gi-bin;export ABC_DEFG_DIR=/opt/abc/cgi-bin;apachectl start"&lt;BR /&gt;&lt;BR /&gt;Will also work. You can also put required things in one file and last statement in this file to start apache.&lt;BR /&gt;&lt;BR /&gt;host_name (user_name) "one_big_script"</description>
      <pubDate>Wed, 21 Sep 2005 01:33:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sudo-environment-settings/m-p/3630884#M237671</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2005-09-21T01:33:01Z</dc:date>
    </item>
    <item>
      <title>Re: sudo environment settings</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sudo-environment-settings/m-p/3630885#M237672</link>
      <description>Yes, Sudo runs with user's environment variable. You can set in his profile. &lt;BR /&gt;&lt;BR /&gt;-Arun &lt;BR /&gt;</description>
      <pubDate>Wed, 21 Sep 2005 01:44:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sudo-environment-settings/m-p/3630885#M237672</guid>
      <dc:creator>Arunvijai_4</dc:creator>
      <dc:date>2005-09-21T01:44:02Z</dc:date>
    </item>
    <item>
      <title>Re: sudo environment settings</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sudo-environment-settings/m-p/3630886#M237673</link>
      <description>Does the command only run as root?  If it runs as another user you can give him permissions to run:&lt;BR /&gt;&lt;BR /&gt;sudo su - &lt;USER&gt;&lt;BR /&gt;&lt;BR /&gt;By doing the above he would get all environment variables that user normally gets.&lt;BR /&gt;&lt;BR /&gt;Of course you would NOT want to set it up to allow him to do "sudo su - root" (or just "su -" which is the same thing).&lt;BR /&gt;&lt;BR /&gt;Alternatively you could create a wrapper script  that sets the above variables then executes the command and give him sudo access to execute that script.  If you do that make sure the wrapper script is only editable by root so that no one puts a back door in it by adding an "su - " statement to it.&lt;/USER&gt;</description>
      <pubDate>Thu, 22 Sep 2005 08:11:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sudo-environment-settings/m-p/3630886#M237673</guid>
      <dc:creator>Jeff Lightner_1</dc:creator>
      <dc:date>2005-09-22T08:11:53Z</dc:date>
    </item>
    <item>
      <title>Re: sudo environment settings</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sudo-environment-settings/m-p/3630887#M237674</link>
      <description>Hi Raje ,&lt;BR /&gt;&lt;BR /&gt;It seems you can put these commands ,&lt;BR /&gt;&lt;BR /&gt;export LD_PRELOAD=/usr/lib/lib123&lt;BR /&gt;export SHLIB_PATH=/usr:/usr/lib:/opt/abc/bin:/opt/abc/bin/lib/ext:/opt/abc/cgi-bin&lt;BR /&gt;export AB_LIBRARY_PATH=/opt/abc/cgi-bin&lt;BR /&gt;export ABC_DEFG_DIR=/opt/abc/cgi-bin&lt;BR /&gt;&lt;BR /&gt;in .profile of the user .&lt;BR /&gt;So when they will run sudo command it will be remain same,&lt;BR /&gt;&lt;BR /&gt;You have to give the permission for running apache commands in /usr/local/etc/sudo/sudoers file.&lt;BR /&gt;&lt;BR /&gt;Once the user .profile executed ..&lt;BR /&gt;the command would be look like that...and can start the apache web server:&lt;BR /&gt;$ /usr/locla/bin/sudo apache start&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;hth,&lt;BR /&gt;Raj.</description>
      <pubDate>Thu, 22 Sep 2005 09:09:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sudo-environment-settings/m-p/3630887#M237674</guid>
      <dc:creator>Raj D.</dc:creator>
      <dc:date>2005-09-22T09:09:39Z</dc:date>
    </item>
    <item>
      <title>Re: sudo environment settings</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sudo-environment-settings/m-p/3630888#M237675</link>
      <description>the user can define his own env vars, sudo will pick them up, except the LD_PRELOAD one!!&lt;BR /&gt;&lt;BR /&gt;from the manpage;&lt;BR /&gt;&lt;BR /&gt;Variables that control how dynamic loading and binding is done can be used to subvert the program that sudo runs.  To combat this the LD_*, _RLD_*, SHLIB_PATH (HP-UX only), and LIBPATH (AIX only) environment variables are removed from the environment passed on to all commands executed.</description>
      <pubDate>Mon, 26 Sep 2005 07:59:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sudo-environment-settings/m-p/3630888#M237675</guid>
      <dc:creator>dirk dierickx</dc:creator>
      <dc:date>2005-09-26T07:59:31Z</dc:date>
    </item>
    <item>
      <title>Re: sudo environment settings</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sudo-environment-settings/m-p/3630889#M237676</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I agree with RAC,&lt;BR /&gt;&lt;BR /&gt;U make a script to start apache as root, set all&lt;BR /&gt;env. in this script, and give access to this&lt;BR /&gt;script in /etc/sudoers to that user.&lt;BR /&gt;This will make /etc/sudoers simple and this is&lt;BR /&gt;more secure also.&lt;BR /&gt;&lt;BR /&gt;-Santosh</description>
      <pubDate>Tue, 16 Jan 2007 02:44:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sudo-environment-settings/m-p/3630889#M237676</guid>
      <dc:creator>SANTOSH S. MHASKAR</dc:creator>
      <dc:date>2007-01-16T02:44:18Z</dc:date>
    </item>
  </channel>
</rss>

