<?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: setuid in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/setuid/m-p/2664397#M49189</link>
    <description>Sorry about the confusion....&lt;BR /&gt;&lt;BR /&gt;I better add that this scripot that is located in /home/root accesses directories owned by root. So when userx executes this script, I would think that userx doesn't get roots permissions, thus is why it is failing. I would definitely prefer sudo access, however, the current situation will not allow this (long story). Also userx is running a restricted shell.&lt;BR /&gt;&lt;BR /&gt;Thanks for the help...</description>
    <pubDate>Thu, 14 Feb 2002 13:30:45 GMT</pubDate>
    <dc:creator>Mike_21</dc:creator>
    <dc:date>2002-02-14T13:30:45Z</dc:date>
    <item>
      <title>setuid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setuid/m-p/2664385#M49177</link>
      <description>Situation: I have a script in the /root directory permissions are rwx for "root only".&lt;BR /&gt;&lt;BR /&gt;I would like to give user x the ability to run this script as root, I know this is possible. I tried to chmod u+s script, it now looks like rws.&lt;BR /&gt;&lt;BR /&gt;This did not work........ DO I have to move this script out of /root?&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Wed, 13 Feb 2002 19:30:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setuid/m-p/2664385#M49177</guid>
      <dc:creator>Mike_21</dc:creator>
      <dc:date>2002-02-13T19:30:37Z</dc:date>
    </item>
    <item>
      <title>Re: setuid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setuid/m-p/2664386#M49178</link>
      <description>If you want the script to run as root, but you want the other user to have access to it, you can do a couple of things.&lt;BR /&gt;&lt;BR /&gt;1)  Change the permissions of the script so that it has group execute permission and then change the group to one that the user is a member of.  Then when the user runs the script, it will run as root.&lt;BR /&gt;&lt;BR /&gt;The script permissions would look like:&lt;BR /&gt;&lt;BR /&gt;-rwsr-x---  1  root somegroup 1234 Feb  13 13:15 script_name&lt;BR /&gt;&lt;BR /&gt;Then you modify /etc/group so that the user is a member of the group somegroup&lt;BR /&gt;&lt;BR /&gt;somegroup::123:userid&lt;BR /&gt;&lt;BR /&gt;The problem with this is that if there are multiple people that are a member of somegroup then ALL of them can run the script.&lt;BR /&gt;&lt;BR /&gt;2)  You could download and install the product sudo &lt;A href="http://hpux.cs.utah.edu/hppd/hpux/Sysadmin/sudo-1.6.2b1/" target="_blank"&gt;http://hpux.cs.utah.edu/hppd/hpux/Sysadmin/sudo-1.6.2b1/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Then you can set up that user in sudo so that he has acccess to that script and no one else does.  This allows you to leave the permissions of the script set to 700 or 500 and root as the owner.&lt;BR /&gt;&lt;BR /&gt;I would personally vote for using sudo.  It allows you to do a lot of things with assigning 'root' privileges to users without them actually having to know the root passwd.  Once sudo is set up, you run a command by doing:&lt;BR /&gt;&lt;BR /&gt;$ sudo command_name&lt;BR /&gt;&lt;BR /&gt;It then prompts the user for their password, if you set it as such, and the command then executes.</description>
      <pubDate>Wed, 13 Feb 2002 19:38:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setuid/m-p/2664386#M49178</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2002-02-13T19:38:26Z</dc:date>
    </item>
    <item>
      <title>Re: setuid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setuid/m-p/2664387#M49179</link>
      <description>You could also use restricted SAM.&lt;BR /&gt;&lt;BR /&gt;You would need to add you script as a custom application.&lt;BR /&gt;&lt;BR /&gt;Then you run sam -r and setup the user(s) you want have acess to this script or any SAM functions.&lt;BR /&gt;&lt;BR /&gt;The downside to this is that the users have to run SAM to run the script.</description>
      <pubDate>Wed, 13 Feb 2002 19:46:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setuid/m-p/2664387#M49179</guid>
      <dc:creator>Krishna Prasad</dc:creator>
      <dc:date>2002-02-13T19:46:38Z</dc:date>
    </item>
    <item>
      <title>Re: setuid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setuid/m-p/2664388#M49180</link>
      <description>Hi,&lt;BR /&gt;You safest bet, to prevent tampering, may be to chmod 555 &amp;lt;script&amp;gt;. This will give you:&lt;BR /&gt;-r-xr-xr-x permissions on the file and prevent anyone from inadvertantly overwriting the script or damaging it. Even a well intentioned root user won't be able to write to it without "forcing" the change.&lt;BR /&gt;Good luck,&lt;BR /&gt;Kel</description>
      <pubDate>Wed, 13 Feb 2002 19:48:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setuid/m-p/2664388#M49180</guid>
      <dc:creator>Kelli Ward</dc:creator>
      <dc:date>2002-02-13T19:48:57Z</dc:date>
    </item>
    <item>
      <title>Re: setuid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setuid/m-p/2664389#M49181</link>
      <description>Ooo... That reminds me. You can also use your file manager to edit the permissions.&lt;BR /&gt;Find the file in your file folder, right click on it, then right click on properties. There will be permission buttons you can click to set the permissions however you wish. &lt;BR /&gt;One: you must be owner to do so.&lt;BR /&gt;Two: You must be running a graphical interface to do this. I.e: CDE or HP-Vue&lt;BR /&gt;Good luck again,&lt;BR /&gt;Kel</description>
      <pubDate>Wed, 13 Feb 2002 19:52:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setuid/m-p/2664389#M49181</guid>
      <dc:creator>Kelli Ward</dc:creator>
      <dc:date>2002-02-13T19:52:16Z</dc:date>
    </item>
    <item>
      <title>Re: setuid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setuid/m-p/2664390#M49182</link>
      <description>Hi all,&lt;BR /&gt;&lt;BR /&gt;Just a word of caution.  Don't set perms to 4555 unless you want everyone to be able to run the script as root.&lt;BR /&gt;&lt;BR /&gt;Darrell</description>
      <pubDate>Wed, 13 Feb 2002 20:04:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setuid/m-p/2664390#M49182</guid>
      <dc:creator>Darrell Allen</dc:creator>
      <dc:date>2002-02-13T20:04:06Z</dc:date>
    </item>
    <item>
      <title>Re: setuid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setuid/m-p/2664391#M49183</link>
      <description>The response that Patrick gave will not work and gives an error message... Permission denied.</description>
      <pubDate>Wed, 13 Feb 2002 20:07:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setuid/m-p/2664391#M49183</guid>
      <dc:creator>Mike_21</dc:creator>
      <dc:date>2002-02-13T20:07:34Z</dc:date>
    </item>
    <item>
      <title>Re: setuid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setuid/m-p/2664392#M49184</link>
      <description>Hi Mike,&lt;BR /&gt;&lt;BR /&gt;I've used Patrick's suggestion a number of times.  Something must be just a little off.&lt;BR /&gt;&lt;BR /&gt;-rwsr-x--- root somegroup ... script_name&lt;BR /&gt;&lt;BR /&gt;That should work in 11.x IF the user is in somegroup (as specified in /etc/group) or somegroup is the users primary group (as specified in /etc/passwd).&lt;BR /&gt;&lt;BR /&gt;If running pre-11.x then you need /etc/logingroup.  Simply create a symlink pointing to /etc/group:&lt;BR /&gt;ln -s /etc/group /etc/logingroup&lt;BR /&gt;&lt;BR /&gt;Darrell</description>
      <pubDate>Wed, 13 Feb 2002 20:34:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setuid/m-p/2664392#M49184</guid>
      <dc:creator>Darrell Allen</dc:creator>
      <dc:date>2002-02-13T20:34:51Z</dc:date>
    </item>
    <item>
      <title>Re: setuid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setuid/m-p/2664393#M49185</link>
      <description>Dang, it helps to read the question.  /root doesn't have permissions for the user.  You either have to open that up or put the script in another directory that the user has r-w perms.&lt;BR /&gt;&lt;BR /&gt;All things considered, sudo and restricted SAM are better choices.&lt;BR /&gt;&lt;BR /&gt;My apologies for not reading better.  Couldn't see the forrest for the trees.&lt;BR /&gt;&lt;BR /&gt;Darrell</description>
      <pubDate>Wed, 13 Feb 2002 20:40:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setuid/m-p/2664393#M49185</guid>
      <dc:creator>Darrell Allen</dc:creator>
      <dc:date>2002-02-13T20:40:05Z</dc:date>
    </item>
    <item>
      <title>Re: setuid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setuid/m-p/2664394#M49186</link>
      <description>What are the permissions on the /root directory, the file you are wanting to execute and what is the output of 'id username' where username is the id of the user that you want to execute this script?</description>
      <pubDate>Wed, 13 Feb 2002 20:45:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setuid/m-p/2664394#M49186</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2002-02-13T20:45:20Z</dc:date>
    </item>
    <item>
      <title>Re: setuid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setuid/m-p/2664395#M49187</link>
      <description>Whoops, I didn't exactly read the post right myself.&lt;BR /&gt;Quick question, This script, does it run internal commands that require root access to use them? I.e: reboot and date&lt;BR /&gt;If not, you may be able to create a copy, owned by the user in their directory. If they do, you may need to give them permission to run the internal "root" commands as well. If, I am now understanding your question correctly.&lt;BR /&gt;Best of luck to you,&lt;BR /&gt;Kel&lt;BR /&gt;</description>
      <pubDate>Wed, 13 Feb 2002 21:03:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setuid/m-p/2664395#M49187</guid>
      <dc:creator>Kelli Ward</dc:creator>
      <dc:date>2002-02-13T21:03:34Z</dc:date>
    </item>
    <item>
      <title>Re: setuid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setuid/m-p/2664396#M49188</link>
      <description>Hi Mike,&lt;BR /&gt;&lt;BR /&gt;If I understood correctly, then you can use the ACL commands for giving access of a specific file for a specific user.&lt;BR /&gt;&lt;BR /&gt;For eg: user1 needs execute permission for a file called /script1, then &lt;BR /&gt;&lt;BR /&gt;# chacl 'user1.%=rx' /script1&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Shiju</description>
      <pubDate>Wed, 13 Feb 2002 21:20:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setuid/m-p/2664396#M49188</guid>
      <dc:creator>Helen French</dc:creator>
      <dc:date>2002-02-13T21:20:14Z</dc:date>
    </item>
    <item>
      <title>Re: setuid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setuid/m-p/2664397#M49189</link>
      <description>Sorry about the confusion....&lt;BR /&gt;&lt;BR /&gt;I better add that this scripot that is located in /home/root accesses directories owned by root. So when userx executes this script, I would think that userx doesn't get roots permissions, thus is why it is failing. I would definitely prefer sudo access, however, the current situation will not allow this (long story). Also userx is running a restricted shell.&lt;BR /&gt;&lt;BR /&gt;Thanks for the help...</description>
      <pubDate>Thu, 14 Feb 2002 13:30:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setuid/m-p/2664397#M49189</guid>
      <dc:creator>Mike_21</dc:creator>
      <dc:date>2002-02-14T13:30:45Z</dc:date>
    </item>
    <item>
      <title>Re: setuid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setuid/m-p/2664398#M49190</link>
      <description>I would try SAM if this is a big if it works with a user you is using restricted SAM?</description>
      <pubDate>Thu, 14 Feb 2002 14:20:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setuid/m-p/2664398#M49190</guid>
      <dc:creator>Krishna Prasad</dc:creator>
      <dc:date>2002-02-14T14:20:33Z</dc:date>
    </item>
    <item>
      <title>Re: setuid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setuid/m-p/2664399#M49191</link>
      <description>It is NOT possible to set the s-bit to a shell script, only for executables.&lt;BR /&gt;Make a little c program with &lt;BR /&gt;system(script)&lt;BR /&gt;in it and set your s-bit to the compiled program.&lt;BR /&gt;&lt;BR /&gt;Ruediger&lt;BR /&gt;</description>
      <pubDate>Thu, 14 Feb 2002 15:10:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setuid/m-p/2664399#M49191</guid>
      <dc:creator>Ruediger Noack</dc:creator>
      <dc:date>2002-02-14T15:10:54Z</dc:date>
    </item>
    <item>
      <title>Re: setuid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setuid/m-p/2664400#M49192</link>
      <description>Hi Mike:&lt;BR /&gt;&lt;BR /&gt;If this is *really* what you want to do, and I'm sure you know the reasons for avoiding 'setuid' and 'setgid' scripts and programs, so I won't lecture, then:&lt;BR /&gt;&lt;BR /&gt;1) Use a Posix script (#!usr/bin/sh)&lt;BR /&gt;2) Make the *owner* of the script 'root'&lt;BR /&gt;3) chmod the script 4555&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 14 Feb 2002 18:14:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setuid/m-p/2664400#M49192</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2002-02-14T18:14:14Z</dc:date>
    </item>
    <item>
      <title>Re: setuid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setuid/m-p/2664401#M49193</link>
      <description>Hi (again) Mike:&lt;BR /&gt;&lt;BR /&gt;...and I should add that the directory in which the script or executable resides is immaterial.  Put it whereever you want/need users to get it.  To a very limited extent, this can help protect it, although these are very dangerous little animals to have.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 14 Feb 2002 18:18:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setuid/m-p/2664401#M49193</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2002-02-14T18:18:43Z</dc:date>
    </item>
    <item>
      <title>Re: setuid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setuid/m-p/2664402#M49194</link>
      <description>No Mike,&lt;BR /&gt;&lt;BR /&gt;sorry to interfere with the "olympian" (not too sorry, though ;-), but it is NOT a good idea to give a setuid script world read permission, simply execute permission for those to start it, and read permission for the owner is enough.&lt;BR /&gt;Even though a setuid script should NOT have any holes in, it is still not advisible to let everybody see how to tamper with it :-(&lt;BR /&gt;&lt;BR /&gt;They should not even *know* it is a script...&lt;BR /&gt;&lt;BR /&gt;Hence for dircteory "/root" and the file "/root/dangerus" you could set the permissions as follows:&lt;BR /&gt;-r-s--x--- 1 root mighty ... /root/dangerous&lt;BR /&gt;-r-xr-xr-- 1 root mighty ... /root&lt;BR /&gt;&lt;BR /&gt;where the user would have to be member of group "mighty" (do you have the sym-link "/etc/logingroup-&amp;gt;/etc/group"???)&lt;BR /&gt;&lt;BR /&gt;Just my $0.2,&lt;BR /&gt;Wodisch</description>
      <pubDate>Thu, 14 Feb 2002 20:18:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setuid/m-p/2664402#M49194</guid>
      <dc:creator>Wodisch</dc:creator>
      <dc:date>2002-02-14T20:18:01Z</dc:date>
    </item>
    <item>
      <title>Re: setuid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setuid/m-p/2664403#M49195</link>
      <description>Sorry Woodisch, but JRF is correct in his assesment of permissions.  A shell script can NOT be executed with having 'read' permission set.&lt;BR /&gt;&lt;BR /&gt;Here's an example.  I created a script called test_script.  It's contents are:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;echo "This is a test on `date`"&lt;BR /&gt;&lt;BR /&gt;Now I set its permissions to 711 (owner is root, group is sys) and tried executing it as a regular user.&lt;BR /&gt;&lt;BR /&gt;$ ll test_script&lt;BR /&gt;-rwx--x--x   1 root       sys             46 Feb 14 14:27 test_script&lt;BR /&gt;$ ./test_script&lt;BR /&gt;/usr/bin/sh: ./test_script: cannot open&lt;BR /&gt;&lt;BR /&gt;But when I change the permissions to 715:&lt;BR /&gt;&lt;BR /&gt;$ ll ./test_script&lt;BR /&gt;-rwx--xr-x   1 root       sys             46 Feb 14 14:27 ./test_script&lt;BR /&gt;$ ./test_script&lt;BR /&gt;This is a test on Thu, Feb 14, 2002 02:28:31 PM&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;So you can not have a shell script with ONLY execute permission.  It won't work.  The read permissions allows your shell to "read", or parse and run, the script.  The execute permission allos you to do a ./scriptname to execute so you don't have to run the script by doing 'sh scriptname'.&lt;BR /&gt;&lt;BR /&gt;You can get away with having execute permission only on a compiled program because it is already compiled and the shell doesn't have to read it.&lt;BR /&gt;&lt;BR /&gt;Sorry to burst your bubble.</description>
      <pubDate>Thu, 14 Feb 2002 20:31:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setuid/m-p/2664403#M49195</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2002-02-14T20:31:06Z</dc:date>
    </item>
    <item>
      <title>Re: setuid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setuid/m-p/2664404#M49196</link>
      <description>Hi Wodisch:&lt;BR /&gt;&lt;BR /&gt;I wholly agree.  Read permissions are unnecessary.  The less known and shown the better.  Thanks!&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 14 Feb 2002 20:34:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setuid/m-p/2664404#M49196</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2002-02-14T20:34:13Z</dc:date>
    </item>
  </channel>
</rss>

