- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Assign root privileges to an other user
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2001 03:07 AM
04-13-2001 03:07 AM
I need to assign the permission of execution of one shell script to an only user (beyond root).
The owner of this shell script is root.
This script executes various commands (It kills processes of which the owner is root, It changes the permissions to some files of which he is not owner, etc...).
I've tried with the command 'chmod +s myscript' but it has not worked.
Some errors:
chmod: Not owner
kill: PID: permission denied
Notes: I can't use "sudo" (It's not supported by HP)!!!
Thanks in advance,
Sergio
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2001 03:26 AM
04-13-2001 03:26 AM
Re: Assign root privileges to an other user
chmod +s is only valid for executables.
You could indeed used sudo,
or you can write & compile a little C-script which simply executes your shell script, and then chmod +s the C-executable.
good luck,
Thierry.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2001 05:35 AM
04-13-2001 05:35 AM
Re: Assign root privileges to an other user
I can think of one other way, but sudo (even I think that sudo would do great because if gives you a monitoring feature as well).
Start restricted sam and set it up through sam.
Restricted sam is started with
#sam -r
Steffi Jones
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2001 08:41 AM
04-13-2001 08:41 AM
Re: Assign root privileges to an other user
also chmod u+s file will work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2001 08:55 AM
04-13-2001 08:55 AM
Re: Assign root privileges to an other user
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2001 11:44 AM
04-13-2001 11:44 AM
Re: Assign root privileges to an other user
I do not agree with Thierry Poels.
chmod +s is valid for scripts also.
You have to insert the first line:
#!/usr/bin/sh
and suid works.
Piotr
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2001 04:31 PM
04-15-2001 04:31 PM
Re: Assign root privileges to an other user
In general, suid scripts and programs do represent a security risk. I myself only use the root suid on programs written in C if absolutely necessary.
Cheers,
Joseph.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2001 10:50 AM
04-17-2001 10:50 AM
Re: Assign root privileges to an other user
Create a new group whose only member is this userid you want empowered. (Alternatively, I use the built-in group "adm" for administration purposes)
chown root:
chmod 4750
This allows members of this restricted group to execute the script which runs as root (from the sticky bit).
I use it for one of my applications that opens port and needs root ownership when running.
Hope this helps...
Ed Ulfers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2001 02:50 AM
04-18-2001 02:50 AM
Re: Assign root privileges to an other user
I have tried with sam -r but I would prefer that the user in issue assumes root privileges only during the execution of the shell-script.
The better thing could be the C-script.
Could you give me more details about this?
Thanks to everyone,
Sergio
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2001 03:07 AM
04-18-2001 03:07 AM
Re: Assign root privileges to an other user
I am using sudo with HP-UX 10.20 and 11.0 and it's OK. I think that this is a very good solution.
Regards,
Manuel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2001 03:49 AM
04-18-2001 03:49 AM
Re: Assign root privileges to an other user
What was being referred to is a C Program. It is relatively easy to use the system() in C to call a standard command. It gets a bit more complex to have this program and what it runs to run as root.
C executes very fast, and has the ability to control all aspects of the environment it is running in. You also have security in the fact that unless you give away your source code, noone can see what is going on. Unlike a script where a user has to have read access. A smart user could potentially use this to do lots of damage to your system!
If your not familiar with Unix C programming, then this will not be easy. If you have no C experience/knowlege at all, then your pretty much SOL cuz it will not be quick and dirty to learn.
Advice. Take C class, then Unix C programming. HP has some nice classes for this, as do lots of Universities.
If you need quick answers, then stick with the scripting for now and follow the advice of others. Or hire a consultant/developer to make the program for you.
Regards,
Shannon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2001 04:23 AM
04-18-2001 04:23 AM
Solutioncreate a file prog.c with following 4 lines:
main()
{
system("/your/dir/yourscript.sh");
}
then compile this little C-program:
cc prog.c
this results in an executable file a.out which you might want to rename to whatever ...
mv a.out whatever
chmod +x whatever # make it executable
chmod +s whatever # set sticky bit
Now let the user execute "whatever", and he will run "yourscript.sh" as root.
(and also award some points to the boys here ;)
good luck,
Thierry.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2001 12:46 AM
04-19-2001 12:46 AM
Re: Assign root privileges to an other user
My problem is now resolved !!!
:-)))
Sergio