<?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 suid doesn't work in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/suid-doesn-t-work/m-p/3387434#M865028</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;-rwsrwxr-x   1 user1    group1      76 Sep 27 14:30 luppa.sh&lt;BR /&gt;&lt;BR /&gt;I need that "user2" that is part of group1 is able to run luppa.sh and the process generated is owned by "user1".&lt;BR /&gt;&lt;BR /&gt;Question 1)&lt;BR /&gt;I have set the suid bit as above but when running the script the process generated is owned by user2 instead of user1.&lt;BR /&gt;&lt;BR /&gt;Question2)&lt;BR /&gt;I need that all the script executed by luppa.sh are owned by user1. Is this possible ?&lt;BR /&gt;In the current test I was not able to make it as well, I mean the process started by luppa.sh was belonging to user2.&lt;BR /&gt;&lt;BR /&gt;How can I make it work ?&lt;BR /&gt;&lt;BR /&gt;Regards.&lt;BR /&gt;Angelo</description>
    <pubDate>Mon, 27 Sep 2004 07:45:08 GMT</pubDate>
    <dc:creator>SILVERSTAR</dc:creator>
    <dc:date>2004-09-27T07:45:08Z</dc:date>
    <item>
      <title>suid doesn't work</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/suid-doesn-t-work/m-p/3387434#M865028</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;-rwsrwxr-x   1 user1    group1      76 Sep 27 14:30 luppa.sh&lt;BR /&gt;&lt;BR /&gt;I need that "user2" that is part of group1 is able to run luppa.sh and the process generated is owned by "user1".&lt;BR /&gt;&lt;BR /&gt;Question 1)&lt;BR /&gt;I have set the suid bit as above but when running the script the process generated is owned by user2 instead of user1.&lt;BR /&gt;&lt;BR /&gt;Question2)&lt;BR /&gt;I need that all the script executed by luppa.sh are owned by user1. Is this possible ?&lt;BR /&gt;In the current test I was not able to make it as well, I mean the process started by luppa.sh was belonging to user2.&lt;BR /&gt;&lt;BR /&gt;How can I make it work ?&lt;BR /&gt;&lt;BR /&gt;Regards.&lt;BR /&gt;Angelo</description>
      <pubDate>Mon, 27 Sep 2004 07:45:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/suid-doesn-t-work/m-p/3387434#M865028</guid>
      <dc:creator>SILVERSTAR</dc:creator>
      <dc:date>2004-09-27T07:45:08Z</dc:date>
    </item>
    <item>
      <title>Re: suid doesn't work</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/suid-doesn-t-work/m-p/3387435#M865029</link>
      <description>This may work on certain versions of HP-UX but be aware that many people consider it a security risk.&lt;BR /&gt;&lt;BR /&gt;Ensure that your script starts with the line:-&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;or whatever shell you are using.&lt;BR /&gt;&lt;BR /&gt;If this still doesn't work, you'll have to write a simple C program which exec's your script.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;John</description>
      <pubDate>Mon, 27 Sep 2004 08:12:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/suid-doesn-t-work/m-p/3387435#M865029</guid>
      <dc:creator>John Palmer</dc:creator>
      <dc:date>2004-09-27T08:12:54Z</dc:date>
    </item>
    <item>
      <title>Re: suid doesn't work</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/suid-doesn-t-work/m-p/3387436#M865030</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I have tried adding the shell specification and building and compiling the c script but I get the same issue.&lt;BR /&gt;&lt;BR /&gt;more run_luppa.c &lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;#include &lt;STDLIB.H&gt;&lt;BR /&gt;#include &lt;UNISTD.H&gt;&lt;BR /&gt;&lt;BR /&gt;main ()&lt;BR /&gt;{&lt;BR /&gt;system ("/EDP/EDP/JOB/luppa.sh");&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I have the following system:&lt;BR /&gt;B.11.11 U 9000/800 1100404631 unlimited-user license&lt;BR /&gt;Do you think it is responsible of this behaviour ?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;/UNISTD.H&gt;&lt;/STDLIB.H&gt;&lt;/STDIO.H&gt;</description>
      <pubDate>Mon, 27 Sep 2004 08:53:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/suid-doesn-t-work/m-p/3387436#M865030</guid>
      <dc:creator>SILVERSTAR</dc:creator>
      <dc:date>2004-09-27T08:53:58Z</dc:date>
    </item>
    <item>
      <title>Re: suid doesn't work</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/suid-doesn-t-work/m-p/3387437#M865031</link>
      <description>You have set the setuid correctly but open to group users / others to execute that particular shell program / c program there.&lt;BR /&gt;&lt;BR /&gt;So that user user2 on group1 will be having the permission to execute from &lt;BR /&gt;-rwsrwxr-x 1 user1 group1 76 Sep 27 14:30 luppa.sh permission there.&lt;BR /&gt;&lt;BR /&gt;Change that too,&lt;BR /&gt;&lt;BR /&gt; 4744 so that group users can read but not write or execute there.&lt;BR /&gt;&lt;BR /&gt;If you change permission of any file , we can control permission there too.&lt;BR /&gt;&lt;BR /&gt;Change permission to 4744 will work there.</description>
      <pubDate>Mon, 27 Sep 2004 09:38:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/suid-doesn-t-work/m-p/3387437#M865031</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2004-09-27T09:38:13Z</dc:date>
    </item>
    <item>
      <title>Re: suid doesn't work</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/suid-doesn-t-work/m-p/3387438#M865032</link>
      <description>Install sudo on your system and it's config is simple. /etc/sudo.conf is what you have to deal with. &lt;BR /&gt;It works nice when we have to such tricks. &lt;BR /&gt;Prashant</description>
      <pubDate>Mon, 27 Sep 2004 09:41:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/suid-doesn-t-work/m-p/3387438#M865032</guid>
      <dc:creator>Prashant Zanwar_4</dc:creator>
      <dc:date>2004-09-27T09:41:46Z</dc:date>
    </item>
    <item>
      <title>Re: suid doesn't work</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/suid-doesn-t-work/m-p/3387439#M865033</link>
      <description>Hi Muthukumar,&lt;BR /&gt;&lt;BR /&gt;I have changed the permission as you have suggested:&lt;BR /&gt;-rwsr--r--   1 users1 group1      92 Sep 27 15:46 luppa.sh&lt;BR /&gt;-rwsr--r--   1 users1 group1      20480 Sep 27 15:29 run_luppa&lt;BR /&gt;&lt;BR /&gt;I am logged as user2 , user2 is in group1.&lt;BR /&gt;&lt;BR /&gt;$ run_luppa&lt;BR /&gt;su: run_luppa: Execute permission denied.&lt;BR /&gt;&lt;BR /&gt;Have I made the changes accordingly to your suggestion ? &lt;BR /&gt;&lt;BR /&gt;thanks&lt;BR /&gt;Angelo&lt;BR /&gt;</description>
      <pubDate>Mon, 27 Sep 2004 10:07:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/suid-doesn-t-work/m-p/3387439#M865033</guid>
      <dc:creator>SILVERSTAR</dc:creator>
      <dc:date>2004-09-27T10:07:47Z</dc:date>
    </item>
    <item>
      <title>Re: suid doesn't work</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/suid-doesn-t-work/m-p/3387440#M865034</link>
      <description>Hi Angelo,&lt;BR /&gt;&lt;BR /&gt;Try taking out the 'read' permissions for anyone except user1 (optional).&lt;BR /&gt;&lt;BR /&gt;$chmod 1511 luppa.sh&lt;BR /&gt;$ll luppa.sh&lt;BR /&gt;&lt;BR /&gt;-r-s--x--x user1 group1 76 Sep 27 14:30 luppa.sh&lt;BR /&gt;&lt;BR /&gt;Also keep #!/usr/bin/ksh (or the shell you are using) as the start of the script as mentioned before.&lt;BR /&gt;&lt;BR /&gt;-Sri&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 27 Sep 2004 10:37:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/suid-doesn-t-work/m-p/3387440#M865034</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2004-09-27T10:37:18Z</dc:date>
    </item>
    <item>
      <title>Re: suid doesn't work</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/suid-doesn-t-work/m-p/3387441#M865035</link>
      <description>SUID program on SHELL scripts are danger. It will make more issues while handling the execution.&lt;BR /&gt;&lt;BR /&gt;I tried as, change the permission of shell file to 4755 (test.sh) and rights as,&lt;BR /&gt;&lt;BR /&gt; 4755 user1 group1 &lt;BR /&gt; &lt;BR /&gt;when user2:group1 tried to execute the shell of,&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;# test.sh &lt;BR /&gt;# 4755 user1 group1&lt;BR /&gt;uname -a&lt;BR /&gt;&lt;BR /&gt;ps -ef | grep -v grep | grep $$&lt;BR /&gt;&lt;BR /&gt;sleep 10&lt;BR /&gt;hostname&lt;BR /&gt;&lt;BR /&gt;# exit &lt;BR /&gt;exit 0&lt;BR /&gt;&lt;BR /&gt;You can see that every process are related to user1 there,&lt;BR /&gt;&lt;BR /&gt;BUT on c coding it is very fine as,&lt;BR /&gt;// test.c - 4755 user1 group1&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;#include &lt;UNISTD.H&gt;&lt;BR /&gt;main()&lt;BR /&gt;{&lt;BR /&gt; printf ("SUID test starts\n");&lt;BR /&gt; sleep(2);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;After the execution monitor with ps as,&lt;BR /&gt;ps -ef | grep -v grep | grep -w 'test'&lt;BR /&gt;--&amp;gt; test object name of executable&lt;BR /&gt;&lt;BR /&gt;Now it is executing with uid of user1 there.&lt;BR /&gt;&lt;BR /&gt;See more about SUID as,&lt;BR /&gt;&lt;A href="http://www.samag.com/documents/s=1149/sam0106a/0106a.htm" target="_blank"&gt;http://www.samag.com/documents/s=1149/sam0106a/0106a.htm&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://www.unix.org.ua/orelly/networking/puis/ch05_05.htm" target="_blank"&gt;http://www.unix.org.ua/orelly/networking/puis/ch05_05.htm&lt;/A&gt;&lt;/UNISTD.H&gt;&lt;/STDIO.H&gt;</description>
      <pubDate>Tue, 28 Sep 2004 05:17:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/suid-doesn-t-work/m-p/3387441#M865035</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2004-09-28T05:17:12Z</dc:date>
    </item>
    <item>
      <title>Re: suid doesn't work</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/suid-doesn-t-work/m-p/3387442#M865036</link>
      <description>And an effective example to your requirement is,&lt;BR /&gt;&lt;BR /&gt; /usr/bin/passwd binary there.&lt;BR /&gt;&lt;BR /&gt; ll /usr/bin/passwd&lt;BR /&gt; will be the answer for this. Change that accordingly so that user operation will be exected with that user id correspondingly.&lt;BR /&gt;&lt;BR /&gt; You can know the file type as,&lt;BR /&gt; $ file /usr/bin/passwd&lt;BR /&gt; so that it is an binary executable.</description>
      <pubDate>Tue, 28 Sep 2004 05:20:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/suid-doesn-t-work/m-p/3387442#M865036</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2004-09-28T05:20:14Z</dc:date>
    </item>
    <item>
      <title>Re: suid doesn't work</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/suid-doesn-t-work/m-p/3387443#M865037</link>
      <description>Hi&lt;BR /&gt;the minimum permissions to reach your goal should be &lt;BR /&gt;rwsr-xr-x   user1   group1&lt;BR /&gt;&lt;BR /&gt;This should be enough. You need both r and x bit on the file to let users belonging to group1 to execute the script (the read permission is a MUST if the file is a script, it is not necessary only if the file is an executable)&lt;BR /&gt;&lt;BR /&gt;No need to sudo, the bit s already makes the trick, the process will have the effective user id as user1 (owning the file) instead tha user2 (execing the file)&lt;BR /&gt;&lt;BR /&gt;Try a simple script like&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;id&lt;BR /&gt;ps -f&lt;BR /&gt;rm -f /tmp/test.out&lt;BR /&gt;touch /tmp/test.out&lt;BR /&gt;&lt;BR /&gt;save it as &lt;BR /&gt;rwsr-xr-x   user1  group1  /tmp/test&lt;BR /&gt;&lt;BR /&gt;and exec it by user2, you should see something like:&lt;BR /&gt;&lt;BR /&gt;uid=302(user2) gid=301(group1) euid=301(user1)&lt;BR /&gt;&lt;BR /&gt;while running the process will be shown as owned by user2, but the privileges are from effective userid (user1).&lt;BR /&gt;To check it, look at the file created by the script (/tmp/test.out): it should be owned by user1, not user2&lt;BR /&gt;&lt;BR /&gt;This means that every command launched from the script will be executed as user1.&lt;BR /&gt;&lt;BR /&gt;Only reason for this not to happen is if the file system has been mounted with option -o nosuid, in this case the bit s on uid will not work completely&lt;BR /&gt;&lt;BR /&gt;hope it helps&lt;BR /&gt;Cesare</description>
      <pubDate>Tue, 28 Sep 2004 05:32:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/suid-doesn-t-work/m-p/3387443#M865037</guid>
      <dc:creator>Cesare Salvioni</dc:creator>
      <dc:date>2004-09-28T05:32:14Z</dc:date>
    </item>
  </channel>
</rss>

