<?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: about setuid in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/about-setuid/m-p/3521579#M220002</link>
    <description>bin is the owner of file useradd&lt;BR /&gt;/usr/sbin/useradd.&lt;BR /&gt;-r-xr-xr-x 1 bin bin 53248 May 12  1998 useradd.&lt;BR /&gt;and my script file :&lt;BR /&gt;-rwsr-xr-x 1 root informix 76 Apr 10 20:22 DBstat.&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Sun, 10 Apr 2005 13:38:45 GMT</pubDate>
    <dc:creator>kamal_15</dc:creator>
    <dc:date>2005-04-10T13:38:45Z</dc:date>
    <item>
      <title>about setuid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/about-setuid/m-p/3521573#M219996</link>
      <description>hi all&lt;BR /&gt;&lt;BR /&gt;i have a problem&lt;BR /&gt;i write a simple script run only under user root. this is the script.(lvdisplay /dev/vg00/lvol1).&lt;BR /&gt;&lt;BR /&gt;i want to make user kamal able to run this script.&lt;BR /&gt;i do the following:&lt;BR /&gt;login as root&lt;BR /&gt;chmod 4777 DBstat&lt;BR /&gt;the result is &lt;BR /&gt;-rwsrwxrwx  1 root  sys 26 Apr 10 18:13 DBstat&lt;BR /&gt;&lt;BR /&gt;but when tryed to execute script under user kamal i receive error&lt;BR /&gt;DBstat: lvdisplay:  not found.&lt;BR /&gt;please expalin why this error ?&lt;BR /&gt;&lt;BR /&gt;note :script works good under root user.&lt;BR /&gt;thankx&lt;BR /&gt;&lt;BR /&gt;kamal</description>
      <pubDate>Sun, 10 Apr 2005 11:55:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/about-setuid/m-p/3521573#M219996</guid>
      <dc:creator>kamal_15</dc:creator>
      <dc:date>2005-04-10T11:55:51Z</dc:date>
    </item>
    <item>
      <title>Re: about setuid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/about-setuid/m-p/3521574#M219997</link>
      <description>Hi,&lt;BR /&gt;The problem is that your PATH is different from root PATH (try echo $PATH for your login and when logged in as root).&lt;BR /&gt;Solution:&lt;BR /&gt;use the absolute path in your script &lt;BR /&gt;/sbin/lvdsplay</description>
      <pubDate>Sun, 10 Apr 2005 13:09:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/about-setuid/m-p/3521574#M219997</guid>
      <dc:creator>Leif Halvarsson_2</dc:creator>
      <dc:date>2005-04-10T13:09:15Z</dc:date>
    </item>
    <item>
      <title>Re: about setuid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/about-setuid/m-p/3521575#M219998</link>
      <description>There are couple of things here !&lt;BR /&gt;&lt;BR /&gt;01. I do not think setuid works for shell scripts it is only for binary executables&lt;BR /&gt;02. Please never ever keep a setuid script with 777 i.e. any tom can change &amp;amp; run it and can blow up your system.&lt;BR /&gt;03. I normally ask my software peer to write a program in C and compile it and then set the permission as 750 and the group would be the user's group.&lt;BR /&gt;&lt;BR /&gt;04. sudo works best here and easy as well&lt;BR /&gt;&lt;BR /&gt;Regds,&lt;BR /&gt;&lt;BR /&gt;Kaps</description>
      <pubDate>Sun, 10 Apr 2005 13:21:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/about-setuid/m-p/3521575#M219998</guid>
      <dc:creator>KapilRaj</dc:creator>
      <dc:date>2005-04-10T13:21:20Z</dc:date>
    </item>
    <item>
      <title>Re: about setuid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/about-setuid/m-p/3521576#M219999</link>
      <description>As has already been said, you need to either use absolute pathnames OR do something like &lt;BR /&gt;PATH=${PATH}:/usr/sbin&lt;BR /&gt;export PATH&lt;BR /&gt;&lt;BR /&gt;inside your script.&lt;BR /&gt;&lt;BR /&gt;I must say that having a setuid script with 4777 mode is really, really dumb. Anyone can alter this script and do great damage. At the very least, change the permissions to 4555 so that no one can write to this file.&lt;BR /&gt;&lt;BR /&gt;Setuid scripts, in general, are a terrible security risk and should be avoided. Use sudo to do this instead.&lt;BR /&gt;</description>
      <pubDate>Sun, 10 Apr 2005 13:22:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/about-setuid/m-p/3521576#M219999</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-04-10T13:22:59Z</dc:date>
    </item>
    <item>
      <title>Re: about setuid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/about-setuid/m-p/3521577#M220000</link>
      <description>many thanks for all&lt;BR /&gt;sorry&lt;BR /&gt;i forget change path.&lt;BR /&gt;now every thing is ok&lt;BR /&gt;but&lt;BR /&gt;when i tryed to change my script to execute command (useradd).&lt;BR /&gt;i recieved messege : Permission Denied&lt;BR /&gt;also i setuid&lt;BR /&gt;what is the problem?&lt;BR /&gt;</description>
      <pubDate>Sun, 10 Apr 2005 13:27:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/about-setuid/m-p/3521577#M220000</guid>
      <dc:creator>kamal_15</dc:creator>
      <dc:date>2005-04-10T13:27:35Z</dc:date>
    </item>
    <item>
      <title>Re: about setuid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/about-setuid/m-p/3521578#M220001</link>
      <description>Is the setuid bit set AND is the file owned by root? Both of those conditions must be met.</description>
      <pubDate>Sun, 10 Apr 2005 13:31:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/about-setuid/m-p/3521578#M220001</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-04-10T13:31:46Z</dc:date>
    </item>
    <item>
      <title>Re: about setuid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/about-setuid/m-p/3521579#M220002</link>
      <description>bin is the owner of file useradd&lt;BR /&gt;/usr/sbin/useradd.&lt;BR /&gt;-r-xr-xr-x 1 bin bin 53248 May 12  1998 useradd.&lt;BR /&gt;and my script file :&lt;BR /&gt;-rwsr-xr-x 1 root informix 76 Apr 10 20:22 DBstat.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sun, 10 Apr 2005 13:38:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/about-setuid/m-p/3521579#M220002</guid>
      <dc:creator>kamal_15</dc:creator>
      <dc:date>2005-04-10T13:38:45Z</dc:date>
    </item>
    <item>
      <title>Re: about setuid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/about-setuid/m-p/3521580#M220003</link>
      <description>Have you su-ed to another user inside this script so that you are no longer root?&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sun, 10 Apr 2005 13:45:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/about-setuid/m-p/3521580#M220003</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-04-10T13:45:25Z</dc:date>
    </item>
    <item>
      <title>Re: about setuid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/about-setuid/m-p/3521581#M220004</link>
      <description>hi all&lt;BR /&gt;there is something i can't understand it.&lt;BR /&gt;&lt;BR /&gt;my login name is kamal.&lt;BR /&gt;when i tryed to execute command (useradd).&lt;BR /&gt;i recieved messege : Permission Denied.&lt;BR /&gt;&lt;BR /&gt;i goto /usr/sbin and make the following :&lt;BR /&gt;1-chown root useradd&lt;BR /&gt;2-chmod 4755 useradd&lt;BR /&gt;&lt;BR /&gt;now i can execute command useradd under my user.&lt;BR /&gt;but the problem is any user can execute this command also.&lt;BR /&gt;when i tryed before to put this command in file .and setuid to this file to root.&lt;BR /&gt;i recieved messege :permission denied.&lt;BR /&gt;&lt;BR /&gt;i want to leave file useradd without any changes . and make file contain command (useradd) and setuid to this file.&lt;BR /&gt;&lt;BR /&gt;is that possipole?</description>
      <pubDate>Sun, 10 Apr 2005 14:07:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/about-setuid/m-p/3521581#M220004</guid>
      <dc:creator>kamal_15</dc:creator>
      <dc:date>2005-04-10T14:07:28Z</dc:date>
    </item>
    <item>
      <title>Re: about setuid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/about-setuid/m-p/3521582#M220005</link>
      <description>You have now seen why setuid scripts are so dangerous. When root owns a setuid script and the permissions allow for anyone to execute it then anyone can do this dangerous task. You could put some logic in your script to determine who the user is but the better approach is to use sudo. It will safely give you the accesss you are looking for.</description>
      <pubDate>Sun, 10 Apr 2005 19:36:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/about-setuid/m-p/3521582#M220005</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-04-10T19:36:47Z</dc:date>
    </item>
    <item>
      <title>Re: about setuid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/about-setuid/m-p/3521583#M220006</link>
      <description>my simple question is:&lt;BR /&gt;&lt;BR /&gt;can i write script contain one command executed only by root(for ex: useradd)&lt;BR /&gt;&lt;BR /&gt;and setuid for this script.&lt;BR /&gt;and run this script under any user except root?&lt;BR /&gt;&lt;BR /&gt;i tryed to do that but i recieved messege :&lt;BR /&gt;permission denied.&lt;BR /&gt;&lt;BR /&gt;is there any thing i gorget?&lt;BR /&gt;thankx</description>
      <pubDate>Mon, 11 Apr 2005 03:14:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/about-setuid/m-p/3521583#M220006</guid>
      <dc:creator>kamal_15</dc:creator>
      <dc:date>2005-04-11T03:14:11Z</dc:date>
    </item>
    <item>
      <title>Re: about setuid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/about-setuid/m-p/3521584#M220007</link>
      <description>sudo&lt;BR /&gt;sudo&lt;BR /&gt;sudo&lt;BR /&gt;sudo&lt;BR /&gt;&lt;BR /&gt;You have already tweaked the os binaries and their permissions ,  never do that.. &lt;BR /&gt;&lt;BR /&gt;for others, does setuid work for shell scripts ?&lt;BR /&gt;&lt;BR /&gt;Regds,&lt;BR /&gt;&lt;BR /&gt;Kaps</description>
      <pubDate>Mon, 11 Apr 2005 09:11:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/about-setuid/m-p/3521584#M220007</guid>
      <dc:creator>KapilRaj</dc:creator>
      <dc:date>2005-04-11T09:11:38Z</dc:date>
    </item>
    <item>
      <title>Re: about setuid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/about-setuid/m-p/3521585#M220008</link>
      <description>Yes, setuid works on shell scripts.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Mon, 11 Apr 2005 09:19:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/about-setuid/m-p/3521585#M220008</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2005-04-11T09:19:36Z</dc:date>
    </item>
    <item>
      <title>Re: about setuid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/about-setuid/m-p/3521586#M220009</link>
      <description>If you're just doing lvdisplay, then just fully quality it /usr/sbin/lvdisplay.  Root permissions are not required to run this command.  Any user can.</description>
      <pubDate>Mon, 11 Apr 2005 09:55:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/about-setuid/m-p/3521586#M220009</guid>
      <dc:creator>Gary L. Paveza, Jr.</dc:creator>
      <dc:date>2005-04-11T09:55:49Z</dc:date>
    </item>
    <item>
      <title>Re: about setuid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/about-setuid/m-p/3521587#M220010</link>
      <description>&lt;BR /&gt;I would suggest that you consdier the Restricted Sam builder.  You can add a script to be executed by sam using whatever userid and you can add scripts or programs to sam and specify what userid can run specific entries in sam.  It is a good functionality that provides full logging.</description>
      <pubDate>Mon, 11 Apr 2005 17:01:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/about-setuid/m-p/3521587#M220010</guid>
      <dc:creator>Emil Velez</dc:creator>
      <dc:date>2005-04-11T17:01:40Z</dc:date>
    </item>
  </channel>
</rss>

