<?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: su -c within a script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/su-c-within-a-script/m-p/4894967#M403052</link>
    <description>root is the only user that can do a su - and not be prompted for an interactive password.&lt;BR /&gt;&lt;BR /&gt;You will need to look at sudo to handle your requirement as written without being prompted for a password.&lt;BR /&gt;&lt;BR /&gt;It is possible to hardcode passwords into scripts, but thats a very bad idea from th security standpoint.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
    <pubDate>Thu, 07 Apr 2005 09:55:49 GMT</pubDate>
    <dc:creator>Steven E. Protter</dc:creator>
    <dc:date>2005-04-07T09:55:49Z</dc:date>
    <item>
      <title>su -c within a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/su-c-within-a-script/m-p/4894964#M403049</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I have a user who needs to su to another userid to run a command within a script.  However, the user is non-root and therefore, a password is required.  The problem is that su will not run from a script because it is interactive and therefore you have to physically type the password.  I was thinking of SUDO, but they don't need to run the program as root.  Any ideas?&lt;BR /&gt;&lt;BR /&gt;BTW, this is required because the user needs to change to the other userid to run the file because of the profile.</description>
      <pubDate>Thu, 07 Apr 2005 09:40:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/su-c-within-a-script/m-p/4894964#M403049</guid>
      <dc:creator>Coolmar</dc:creator>
      <dc:date>2005-04-07T09:40:23Z</dc:date>
    </item>
    <item>
      <title>Re: su -c within a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/su-c-within-a-script/m-p/4894965#M403050</link>
      <description>Sally,&lt;BR /&gt;not sure about this, but would setting the sticky bit help?&lt;BR /&gt;Also chmod the file to allow user 1 to run the file.&lt;BR /&gt;Regards</description>
      <pubDate>Thu, 07 Apr 2005 09:47:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/su-c-within-a-script/m-p/4894965#M403050</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2005-04-07T09:47:19Z</dc:date>
    </item>
    <item>
      <title>Re: su -c within a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/su-c-within-a-script/m-p/4894966#M403051</link>
      <description>sally,&lt;BR /&gt;&lt;BR /&gt;What is the issue with sudo. You are not executing your program as root. If you do sudo su - user2 -c "program" your effective user id is user2 not root.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 07 Apr 2005 09:53:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/su-c-within-a-script/m-p/4894966#M403051</guid>
      <dc:creator>Rajeev Tyagi</dc:creator>
      <dc:date>2005-04-07T09:53:40Z</dc:date>
    </item>
    <item>
      <title>Re: su -c within a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/su-c-within-a-script/m-p/4894967#M403052</link>
      <description>root is the only user that can do a su - and not be prompted for an interactive password.&lt;BR /&gt;&lt;BR /&gt;You will need to look at sudo to handle your requirement as written without being prompted for a password.&lt;BR /&gt;&lt;BR /&gt;It is possible to hardcode passwords into scripts, but thats a very bad idea from th security standpoint.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Thu, 07 Apr 2005 09:55:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/su-c-within-a-script/m-p/4894967#M403052</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2005-04-07T09:55:49Z</dc:date>
    </item>
    <item>
      <title>Re: su -c within a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/su-c-within-a-script/m-p/4894968#M403053</link>
      <description>You can use except tool for it.&lt;BR /&gt;Get it here - &lt;A href="http://hpux.connect.org.uk" target="_blank"&gt;http://hpux.connect.org.uk&lt;/A&gt;</description>
      <pubDate>Thu, 07 Apr 2005 10:02:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/su-c-within-a-script/m-p/4894968#M403053</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2005-04-07T10:02:50Z</dc:date>
    </item>
    <item>
      <title>Re: su -c within a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/su-c-within-a-script/m-p/4894969#M403054</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;if you need just entries out of the environment of that other user, these should be transferred to a seperate script (e.g. set.env). Then they can be sourced by every user who needs them (". set.env" for Bourne-like or "source set.env" for CSH-like Shells).&lt;BR /&gt;&lt;BR /&gt;If there are other reason to switch to another user from a non-root account, you can try to replace the 'su' by 'rsh localhost' or 'ssh localhost'. These commands can easily be setup to lack the need of entering a password.&lt;BR /&gt;&lt;BR /&gt;mfG Peter</description>
      <pubDate>Thu, 07 Apr 2005 11:57:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/su-c-within-a-script/m-p/4894969#M403054</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2005-04-07T11:57:51Z</dc:date>
    </item>
    <item>
      <title>Re: su -c within a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/su-c-within-a-script/m-p/4894970#M403055</link>
      <description>Setup SUDO and it worked like a charm.  Thanks!</description>
      <pubDate>Thu, 07 Apr 2005 12:52:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/su-c-within-a-script/m-p/4894970#M403055</guid>
      <dc:creator>Coolmar</dc:creator>
      <dc:date>2005-04-07T12:52:12Z</dc:date>
    </item>
  </channel>
</rss>

