Operating System - HP-UX
1836618 Members
1877 Online
110102 Solutions
New Discussion

Running root app being raw user

 
Maxim Yakimenko
Super Advisor

Running root app being raw user

Hi, collegues

I want to give abiltity to run kmeminfo to user on my system, and only to this user. How to do this. I tried to achive it with script

ID=`id -u`
if [ $ID -eq 106 ]; then
echo brtuser
chmod u+s /usr/local/sbin/kmeminfo
/usr/local/sbin/kmeminfo
chmod u-s /usr/local/sbin/kmeminfo
else
echo "You are not allowed to run this command"
fi

and did chmod u+s to this script.
current perms ob this script is
-rwsr-sr-x root sys

But when I su to user and run this script it fails

chmod: can't access /usr/local/sbin/kmeminfo
/usr/local/bin/ukmeminfo: line 13: /usr/local/sbin/kmeminfo: Permission denied


What to do?
5 REPLIES 5
Torsten.
Acclaimed Contributor

Re: Running root app being raw user

What to do?

SUDO!

http://hpux.asknet.de/hppd/hpux/Sysadmin/sudo-1.6.8p12/

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Maxim Yakimenko
Super Advisor

Re: Running root app being raw user

Damn, Torsten, you are defintly right, how I could forget it :)

Thanks
Maxim Yakimenko
Super Advisor

Re: Running root app being raw user

-
Torsten.
Acclaimed Contributor

Re: Running root app being raw user

Ð¿Ð¾Ð¶Ð°Ð»Ñ Ð¹Ñ Ñ Ð°!

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Torsten.
Acclaimed Contributor

Re: Running root app being raw user

Looks like the site cannot deal with russian characters.
Anyway - you are welcome.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!