<?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: Script Question in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/3033205#M132940</link>
    <description>Hi ,&lt;BR /&gt;&lt;BR /&gt;you can also make use of stiky bit &lt;BR /&gt;&lt;BR /&gt;rwS------  and change the owner of the file  to root ..&lt;BR /&gt;&lt;BR /&gt;But be careful ... Its a risky business .. :)&lt;BR /&gt;&lt;BR /&gt;-Niraj</description>
    <pubDate>Fri, 25 Jul 2003 09:15:49 GMT</pubDate>
    <dc:creator>Niraj Kumar Verma</dc:creator>
    <dc:date>2003-07-25T09:15:49Z</dc:date>
    <item>
      <title>Script Question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/3033201#M132936</link>
      <description>Hi All&lt;BR /&gt;&lt;BR /&gt;I have a scripting question.&lt;BR /&gt;&lt;BR /&gt;I have to run this shell script as a normal user but have to insert couple of entries&lt;BR /&gt;into the /etc/services file where this user does not have the write access. &lt;BR /&gt;&lt;BR /&gt;One of the requirement is that it should not be interactive. So I thought I could read the super&lt;BR /&gt;user username and password as arguments to the script and call "su" and pass it on to it.&lt;BR /&gt;But I have no idea how to pass the password to su non interactively.&lt;BR /&gt;&lt;BR /&gt;Can you please help me? &lt;BR /&gt;&lt;BR /&gt;Thanks in advance.&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;Binu</description>
      <pubDate>Fri, 25 Jul 2003 04:55:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/3033201#M132936</guid>
      <dc:creator>Binu Raj</dc:creator>
      <dc:date>2003-07-25T04:55:05Z</dc:date>
    </item>
    <item>
      <title>Re: Script Question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/3033202#M132937</link>
      <description>Hi Binu,&lt;BR /&gt;Passing superuser username/password to a script ... not a good idea !&lt;BR /&gt;&lt;BR /&gt;You should use sudo for this (&lt;A href="http://www.courtesan.com/sudo/)" target="_blank"&gt;http://www.courtesan.com/sudo/)&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Make a script that changes the services-file, allow the user to execute this script as root through sudo ... and you're set.&lt;BR /&gt;&lt;BR /&gt;Hope this helps,&lt;BR /&gt;Tom Geudens</description>
      <pubDate>Fri, 25 Jul 2003 05:14:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/3033202#M132937</guid>
      <dc:creator>Tom Geudens</dc:creator>
      <dc:date>2003-07-25T05:14:52Z</dc:date>
    </item>
    <item>
      <title>Re: Script Question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/3033203#M132938</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;try to have a look at program "expect".&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://hpux.connect.org.uk/hppd/hpux/Tcl/expect-5.38/" target="_blank"&gt;http://hpux.connect.org.uk/hppd/hpux/Tcl/expect-5.38/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;&lt;BR /&gt;Radim</description>
      <pubDate>Fri, 25 Jul 2003 05:20:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/3033203#M132938</guid>
      <dc:creator>Radim Jarosek</dc:creator>
      <dc:date>2003-07-25T05:20:48Z</dc:date>
    </item>
    <item>
      <title>Re: Script Question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/3033204#M132939</link>
      <description>You shouldn't pass root's password to processes at all.&lt;BR /&gt;&lt;BR /&gt;The probably easiest, and with greatest control solution is the mentioned editing via sudo.&lt;BR /&gt;&lt;BR /&gt;Another maybe could be to make an access control list (ACL) for /etc/services which gives the script executing uid write permissions (but maintaining ACLs can be problematic, especially with backups).&lt;BR /&gt;&lt;BR /&gt;Yet another possibility could be to script something that starts execution as euid == 0, then forks off a child that su's to the respective uid, and let the child do what needs to be done under this uid.&lt;BR /&gt;Then when it comes to updating /etc/services this could be handled by the parent process that as euid == 0 has ultimate control.</description>
      <pubDate>Fri, 25 Jul 2003 06:57:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/3033204#M132939</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2003-07-25T06:57:10Z</dc:date>
    </item>
    <item>
      <title>Re: Script Question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/3033205#M132940</link>
      <description>Hi ,&lt;BR /&gt;&lt;BR /&gt;you can also make use of stiky bit &lt;BR /&gt;&lt;BR /&gt;rwS------  and change the owner of the file  to root ..&lt;BR /&gt;&lt;BR /&gt;But be careful ... Its a risky business .. :)&lt;BR /&gt;&lt;BR /&gt;-Niraj</description>
      <pubDate>Fri, 25 Jul 2003 09:15:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/3033205#M132940</guid>
      <dc:creator>Niraj Kumar Verma</dc:creator>
      <dc:date>2003-07-25T09:15:49Z</dc:date>
    </item>
    <item>
      <title>Re: Script Question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/3033206#M132941</link>
      <description>Hi ,&lt;BR /&gt;&lt;BR /&gt;you can also make use of stiky bit &lt;BR /&gt;&lt;BR /&gt;rwS------  and change the owner of the file  to root ..&lt;BR /&gt;&lt;BR /&gt;But be careful ... Its a risky business .. :)&lt;BR /&gt;&lt;BR /&gt;-Niraj</description>
      <pubDate>Fri, 25 Jul 2003 09:16:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/3033206#M132941</guid>
      <dc:creator>Niraj Kumar Verma</dc:creator>
      <dc:date>2003-07-25T09:16:08Z</dc:date>
    </item>
    <item>
      <title>Re: Script Question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/3033207#M132942</link>
      <description>Binu,&lt;BR /&gt;as far as I'm aware you cannot pass a password to su as an argument.&lt;BR /&gt;This is a (security) feature not a bug.&lt;BR /&gt;The same is true for the passwd command as well.&lt;BR /&gt;&lt;BR /&gt;In addition to the possible solutions provided earlier you might look into creating a new group (e.g. serupd). Change the group on /etc/services to serupd and change the mode to 775. Put your user in that group and you are done.&lt;BR /&gt;Alternatively, you might like to look into Access Control Lists. This will give you a greater level of granularity than the 'standard' owner/group/other permissions&lt;BR /&gt;See 'man 5 aclv' for details.&lt;BR /&gt;If your root volume is a VxFS version 4 filesystem then it supports ACLs&lt;BR /&gt;It is also possible to upgrade earlier versions to version 4 (but I have no experience of doing this).&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Michael.</description>
      <pubDate>Fri, 25 Jul 2003 10:55:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/3033207#M132942</guid>
      <dc:creator>Michael Kelly_5</dc:creator>
      <dc:date>2003-07-25T10:55:46Z</dc:date>
    </item>
    <item>
      <title>Re: Script Question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/3033208#M132943</link>
      <description>Binu,&lt;BR /&gt;&lt;BR /&gt;I do something similar, and got it working with sudo.&lt;BR /&gt;&lt;BR /&gt;Take care&lt;BR /&gt;Donny</description>
      <pubDate>Fri, 25 Jul 2003 11:22:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/3033208#M132943</guid>
      <dc:creator>Donny Jekels</dc:creator>
      <dc:date>2003-07-25T11:22:57Z</dc:date>
    </item>
    <item>
      <title>Re: Script Question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/3033209#M132944</link>
      <description>Hello!&lt;BR /&gt;&lt;BR /&gt;Best is to run the part that you need to do&lt;BR /&gt;as a root with program called sudo&lt;BR /&gt;that run with root priv. the wanted commands.&lt;BR /&gt;&lt;BR /&gt;Download from:&lt;BR /&gt;&lt;A href="http://hpux.connect.org.uk/hppd/hpux/Sysadmin/sudo-1.6.6/" target="_blank"&gt;http://hpux.connect.org.uk/hppd/hpux/Sysadmin/sudo-1.6.6/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Caesar</description>
      <pubDate>Fri, 25 Jul 2003 11:26:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/3033209#M132944</guid>
      <dc:creator>Caesar_3</dc:creator>
      <dc:date>2003-07-25T11:26:32Z</dc:date>
    </item>
    <item>
      <title>Re: Script Question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/3033210#M132945</link>
      <description>you can do that with sudo.&lt;BR /&gt;&lt;BR /&gt;Run your script with sudo, it will be run with root user as it's owner. Setting setuid bit is riksy business.</description>
      <pubDate>Fri, 25 Jul 2003 11:29:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/3033210#M132945</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2003-07-25T11:29:50Z</dc:date>
    </item>
  </channel>
</rss>

