<?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: suid, sticky bit or setprivgrp? in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/suid-sticky-bit-or-setprivgrp/m-p/2932991#M112010</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;You can accomplist it by setting an suid bit on the script. You will need to make sure the others have only execute permissions in order for a script to run as suid.&lt;BR /&gt;&lt;BR /&gt;However, I would not suggest playing around with suid,sgid etc.,. &lt;BR /&gt;&lt;BR /&gt;SUDO is a good tool that is so flexible that you can do what you want.&lt;BR /&gt;&lt;BR /&gt;You can get it from HP's porting center&lt;BR /&gt;&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;Look at the sudoers file man documentation for more details at&lt;BR /&gt;&lt;BR /&gt;&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;For ex., following in the sudoers file&lt;BR /&gt;&lt;BR /&gt;sridhar           myhost = (oracle) /home/oracle/scripts/shutdown_oracle&lt;BR /&gt;&lt;BR /&gt;sridhar:&amp;gt;sudo -u oracle /home/oracle/scripts/shutdown_oracle&lt;BR /&gt;&lt;BR /&gt;will allow me to run that script as oracle.&lt;BR /&gt;&lt;BR /&gt;-Sri &lt;BR /&gt;</description>
    <pubDate>Fri, 21 Mar 2003 16:02:08 GMT</pubDate>
    <dc:creator>Sridhar Bhaskarla</dc:creator>
    <dc:date>2003-03-21T16:02:08Z</dc:date>
    <item>
      <title>suid, sticky bit or setprivgrp?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/suid-sticky-bit-or-setprivgrp/m-p/2932990#M112009</link>
      <description>I have done alot of reading on "suid, sticky bit and setprivgrp", but I'm having problems determining the correct path of action for the following.&lt;BR /&gt;&lt;BR /&gt;Our cron controled batch schedule is run by the user "prodbat". At the moment "prodbat" is a member of the "csi" group only.&lt;BR /&gt;At some point in the schedule an Oracle backup must be performed by "prodbat" as the user Oracle by virtue of "group" rights.&lt;BR /&gt;The script has the following attributes; -rwxrwxr--   1 m10000     dba            656 Feb 27  2002 script003&lt;BR /&gt;&lt;BR /&gt;How can I make it so "prodbat" can do a suid to Oracle and run the script?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks, ~jdk&lt;BR /&gt;</description>
      <pubDate>Fri, 21 Mar 2003 15:40:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/suid-sticky-bit-or-setprivgrp/m-p/2932990#M112009</guid>
      <dc:creator>TrustNo1</dc:creator>
      <dc:date>2003-03-21T15:40:36Z</dc:date>
    </item>
    <item>
      <title>Re: suid, sticky bit or setprivgrp?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/suid-sticky-bit-or-setprivgrp/m-p/2932991#M112010</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;You can accomplist it by setting an suid bit on the script. You will need to make sure the others have only execute permissions in order for a script to run as suid.&lt;BR /&gt;&lt;BR /&gt;However, I would not suggest playing around with suid,sgid etc.,. &lt;BR /&gt;&lt;BR /&gt;SUDO is a good tool that is so flexible that you can do what you want.&lt;BR /&gt;&lt;BR /&gt;You can get it from HP's porting center&lt;BR /&gt;&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;Look at the sudoers file man documentation for more details at&lt;BR /&gt;&lt;BR /&gt;&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;For ex., following in the sudoers file&lt;BR /&gt;&lt;BR /&gt;sridhar           myhost = (oracle) /home/oracle/scripts/shutdown_oracle&lt;BR /&gt;&lt;BR /&gt;sridhar:&amp;gt;sudo -u oracle /home/oracle/scripts/shutdown_oracle&lt;BR /&gt;&lt;BR /&gt;will allow me to run that script as oracle.&lt;BR /&gt;&lt;BR /&gt;-Sri &lt;BR /&gt;</description>
      <pubDate>Fri, 21 Mar 2003 16:02:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/suid-sticky-bit-or-setprivgrp/m-p/2932991#M112010</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2003-03-21T16:02:08Z</dc:date>
    </item>
    <item>
      <title>Re: suid, sticky bit or setprivgrp?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/suid-sticky-bit-or-setprivgrp/m-p/2932992#M112011</link>
      <description>Sticky bit is set on /tmp for all to use this is an example for you to consider.  Do you want the world to have access?  (* Hacker's dream *)&lt;BR /&gt;&lt;BR /&gt;sticky bit:&lt;BR /&gt;chmod 1xxx /dir/file&lt;BR /&gt;&lt;BR /&gt;rwxrwxrwt  &amp;lt;== looks like  Note the "t"&lt;BR /&gt;&lt;BR /&gt;set gid:&lt;BR /&gt;chmod 2xxx /dir/file&lt;BR /&gt;&lt;BR /&gt;rwxrwsrwx  &amp;lt;== looks like  Note the "s"&lt;BR /&gt;&lt;BR /&gt;set uid:&lt;BR /&gt;chmod 4xxx /dir/file&lt;BR /&gt;&lt;BR /&gt;rwsrwxrwx  &amp;lt;=== looks like Note the "s"</description>
      <pubDate>Fri, 21 Mar 2003 17:52:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/suid-sticky-bit-or-setprivgrp/m-p/2932992#M112011</guid>
      <dc:creator>Michael Steele_2</dc:creator>
      <dc:date>2003-03-21T17:52:32Z</dc:date>
    </item>
    <item>
      <title>Re: suid, sticky bit or setprivgrp?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/suid-sticky-bit-or-setprivgrp/m-p/2932993#M112012</link>
      <description>Sidhar, the powers that be, don't care for the "sudo" idea, we've been down that road before and I lost.&lt;BR /&gt;Until now Ive been able to deal with id acceses through creative means.&lt;BR /&gt;&lt;BR /&gt;M., I would like for the user "prodbat" to be able to execute a particular file as the user oracle (gid=dba).&lt;BR /&gt;Do I place the sticky bit on the group permissions of the file, then make "prodbat" a member of the that group?&lt;BR /&gt;Thanks, ~jdk&lt;BR /&gt;</description>
      <pubDate>Fri, 21 Mar 2003 19:25:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/suid-sticky-bit-or-setprivgrp/m-p/2932993#M112012</guid>
      <dc:creator>TrustNo1</dc:creator>
      <dc:date>2003-03-21T19:25:23Z</dc:date>
    </item>
    <item>
      <title>Re: suid, sticky bit or setprivgrp?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/suid-sticky-bit-or-setprivgrp/m-p/2932994#M112013</link>
      <description>I think you want the setgid bit and not the sticky bit.&lt;BR /&gt;&lt;BR /&gt;set gid: &lt;BR /&gt;chmod 2xxx /dir/file &lt;BR /&gt;&lt;BR /&gt;This would satisfy:&lt;BR /&gt;&lt;BR /&gt;"...Do I place the sticky bit on the group permissions of the file, then make "prodbat" a member of the that group?..." &lt;BR /&gt;</description>
      <pubDate>Fri, 21 Mar 2003 19:30:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/suid-sticky-bit-or-setprivgrp/m-p/2932994#M112013</guid>
      <dc:creator>Michael Steele_2</dc:creator>
      <dc:date>2003-03-21T19:30:06Z</dc:date>
    </item>
    <item>
      <title>Re: suid, sticky bit or setprivgrp?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/suid-sticky-bit-or-setprivgrp/m-p/2932995#M112014</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Why don't you just add prodbat to the dba group?&lt;BR /&gt;Doesn't matter if dba is primary or secondary group for the prodbat user.&lt;BR /&gt;All you need is prodbat in the dba group.&lt;BR /&gt;&lt;BR /&gt;My $0.02,&lt;BR /&gt;Jeff</description>
      <pubDate>Fri, 21 Mar 2003 19:31:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/suid-sticky-bit-or-setprivgrp/m-p/2932995#M112014</guid>
      <dc:creator>Jeff Schussele</dc:creator>
      <dc:date>2003-03-21T19:31:49Z</dc:date>
    </item>
    <item>
      <title>Re: suid, sticky bit or setprivgrp?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/suid-sticky-bit-or-setprivgrp/m-p/2932996#M112015</link>
      <description>Hi Jdk,&lt;BR /&gt;&lt;BR /&gt;I suggest the following *reluctantly* since you don't have any choice.&lt;BR /&gt;&lt;BR /&gt;Yes. Create a seperate group (say prodgrp) with prodbat as only the member. On the file that is to be run as oracle, give *only* execute permission for prodbat and suid for oracle. It would look like this&lt;BR /&gt;&lt;BR /&gt;#chgrp prodgrp /home/oracle/script&lt;BR /&gt;#chmod 4510 /home/oracle/script&lt;BR /&gt;#ll /home/oracle/script&lt;BR /&gt;-r-s--x---   1 oracle   prodgrp          1168 Jan 30 13:27 script&lt;BR /&gt;&lt;BR /&gt;Keep monitoring the permissions on the script and the members in prodgrp group.&lt;BR /&gt;&lt;BR /&gt;-Sri&lt;BR /&gt;</description>
      <pubDate>Fri, 21 Mar 2003 20:06:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/suid-sticky-bit-or-setprivgrp/m-p/2932996#M112015</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2003-03-21T20:06:35Z</dc:date>
    </item>
    <item>
      <title>Re: suid, sticky bit or setprivgrp?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/suid-sticky-bit-or-setprivgrp/m-p/2932997#M112016</link>
      <description>OK, when the process runs, it runs as "prodbat", not oracle.&lt;BR /&gt;I think I need to be able do do the equuivilent to a "su" to oracle and execute the file without the password.&lt;BR /&gt;Does that sound right?&lt;BR /&gt;&lt;BR /&gt;Thanks, ~jdk</description>
      <pubDate>Fri, 21 Mar 2003 21:03:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/suid-sticky-bit-or-setprivgrp/m-p/2932997#M112016</guid>
      <dc:creator>TrustNo1</dc:creator>
      <dc:date>2003-03-21T21:03:08Z</dc:date>
    </item>
    <item>
      <title>Re: suid, sticky bit or setprivgrp?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/suid-sticky-bit-or-setprivgrp/m-p/2932998#M112017</link>
      <description>Just try including "prodbat" user into 'dba' group file as secondary group. &lt;BR /&gt;After including into group file,you can use 'newgrp' command  to change effective group id.&lt;BR /&gt;&lt;BR /&gt;Please see this example,&lt;BR /&gt;&lt;BR /&gt;dmcspa 23: id&lt;BR /&gt;uid=168(omnioper) gid=20(users)&lt;BR /&gt;dmcspa 24: newgrp omniback&lt;BR /&gt;dmcspa 21: id&lt;BR /&gt;uid=168(omnioper) gid=109(omniback) groups=20(users)&lt;BR /&gt;dmcspa 22: &lt;BR /&gt;&lt;BR /&gt;So before "prodbat" run backup , include the line&lt;BR /&gt;'newgrp dba' command ( it will create shell with dba group previlage. Next line run regular oracle backup command follows. &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Reference from man pages&lt;BR /&gt;&lt;BR /&gt;           4000  (= u=s)  Set user ID on file execution (file only)&lt;BR /&gt;           2000  (= g=s)  Set group ID on file execution (file only)&lt;BR /&gt;&lt;BR /&gt;                              Add or delete the save-text-image-on-file- execution (sticky bit) permission.  Useful          only if u is expressed or implied in who.&lt;BR /&gt;</description>
      <pubDate>Fri, 21 Mar 2003 21:13:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/suid-sticky-bit-or-setprivgrp/m-p/2932998#M112017</guid>
      <dc:creator>Nesan</dc:creator>
      <dc:date>2003-03-21T21:13:20Z</dc:date>
    </item>
    <item>
      <title>Re: suid, sticky bit or setprivgrp?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/suid-sticky-bit-or-setprivgrp/m-p/2932999#M112018</link>
      <description>Hi Jdk,&lt;BR /&gt;&lt;BR /&gt;No. If the permissions are looking like what I indicated, 'prodbat' can run this script directly and it will run as 'oracle' as it has the suid bit.&lt;BR /&gt;&lt;BR /&gt;prodbat:&amp;gt;/home/oracle/script&lt;BR /&gt;&lt;BR /&gt;I would not suggest you to add prodbat to dba group as it will open up permissions for this user for all the files that are group owned by dba. And that's the reason why I suggested to create a seperate group only for this purpose. This way only 'oracle' owns the file and only 'prodbat' executes it.&lt;BR /&gt;&lt;BR /&gt;-Sri</description>
      <pubDate>Fri, 21 Mar 2003 21:48:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/suid-sticky-bit-or-setprivgrp/m-p/2932999#M112018</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2003-03-21T21:48:07Z</dc:date>
    </item>
    <item>
      <title>Re: suid, sticky bit or setprivgrp?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/suid-sticky-bit-or-setprivgrp/m-p/2933000#M112019</link>
      <description>Exceeeeelent answers guys! Now I more or less comprehend what it was I read in the man pages...jeeze I'm kinda' dense sometimes.&lt;BR /&gt;I do have a question, using Sridhar's example (thank goodness for test boxes), my test script "touches a file$$, then starts a "until flag=1" background process.&lt;BR /&gt;The new file is owned by "prodbat" and has "prodgrp" as the group as expected.&lt;BR /&gt;The background process owner is prodbat.&lt;BR /&gt;    Thoughts?&lt;BR /&gt;Thanks,~jdk</description>
      <pubDate>Mon, 24 Mar 2003 18:32:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/suid-sticky-bit-or-setprivgrp/m-p/2933000#M112019</guid>
      <dc:creator>TrustNo1</dc:creator>
      <dc:date>2003-03-24T18:32:02Z</dc:date>
    </item>
    <item>
      <title>Re: suid, sticky bit or setprivgrp?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/suid-sticky-bit-or-setprivgrp/m-p/2933001#M112020</link>
      <description>Hi Jdk,&lt;BR /&gt;&lt;BR /&gt;You don't need a test box to try this.:-).  Say you have access to two accounts you can play with it. accoutn1 and account2 are in the group mygrp.&lt;BR /&gt;&lt;BR /&gt;account1:&amp;gt;pwd&lt;BR /&gt;/home/account1&lt;BR /&gt;account1:&amp;gt; cat sc&lt;BR /&gt;r&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;touch /tmp/account1.file&lt;BR /&gt;&lt;BR /&gt;account1:&amp;gt;chgrp mygrp scr&lt;BR /&gt;account1:&amp;gt;chmod 4510 scr&lt;BR /&gt;account1:&amp;gt;ll scr&lt;BR /&gt;-r-s--x---   1 account1            mygrp            Mar 24 13:00 scr&lt;BR /&gt;su - account2&lt;BR /&gt;account2:&amp;gt;/home/account1/scr&lt;BR /&gt;account2:&amp;gt; ll /tmp/account1.file&lt;BR /&gt;-rwx-r-----   1 account1          mygrp            0 Mar 24 13:01 /tmp/account1.file&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The effective user id will become the owner of the file and hence it will run as account1. However, you will not be able to verify it through ps command.&lt;BR /&gt;&lt;BR /&gt;However, you can mount the filesystems with nosuid option to disallow this. &lt;BR /&gt;&lt;BR /&gt;-Sri</description>
      <pubDate>Mon, 24 Mar 2003 19:37:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/suid-sticky-bit-or-setprivgrp/m-p/2933001#M112020</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2003-03-24T19:37:42Z</dc:date>
    </item>
    <item>
      <title>Re: suid, sticky bit or setprivgrp?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/suid-sticky-bit-or-setprivgrp/m-p/2933002#M112021</link>
      <description>Sridhar,&lt;BR /&gt;Thanks for the clarification. If I could assign 12 points, I would.&lt;BR /&gt;It was the "ps" owner that had me.&lt;BR /&gt;The owner of the process is  usefull information if I need to track it with measureware.&lt;BR /&gt;&lt;BR /&gt;Thanks for all your assistance,   ~jdk</description>
      <pubDate>Tue, 25 Mar 2003 13:18:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/suid-sticky-bit-or-setprivgrp/m-p/2933002#M112021</guid>
      <dc:creator>TrustNo1</dc:creator>
      <dc:date>2003-03-25T13:18:05Z</dc:date>
    </item>
  </channel>
</rss>

