- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: SUID not working
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
12-11-2002 01:48 PM
12-11-2002 01:48 PM
/dev/vg00/lvol6 /opt vxfs delaylog 0 2
I created a wrapper script that has about 3-4 layers for starting up different 3rd party applications. The wrapper script and its underlying layers all exist under the /opt filesystem. I have SUID bits set on the underlying layers. But whenever I execute the wrapper script, it will run all underlying layers as the user that executed the wrapper script. I dont have the SUID bit set on the wrapper script either. My implementation works correctly on Solaris. I should mention that some underlying layers need to run as a different user than other layers. The use of
"su - user -c command" has provided me unstable results also. I would appreciate any help or ideas.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2002 01:59 PM
12-11-2002 01:59 PM
Re: SUID not working
I think the easiest thing to do would be to attach your script for us to have a look at. Who actually kicks off the script ? root or another user ? If the user is not root then they will need a password to su , could this be causing your problem ?
Regards
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2002 10:42 PM
12-11-2002 10:42 PM
Re: SUID not working
setting it for a script also is of no use. do it for actual binaries (commands).
kaps.........
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2002 10:47 PM
12-11-2002 10:47 PM
Re: SUID not working
There are operating system like AIX ( some versions ) which does not support setting SUID in the shell scripts and other scripts for security reason.
If my memory serves me right , HP-UX is in that list. you can setuid only on binaries.
regards,
U.SivaKumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2002 11:02 PM
12-11-2002 11:02 PM
Re: SUID not working
Shiva ??? from HCL ????. Can i have u'r email id ????.
kaps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2002 11:05 PM
12-11-2002 11:05 PM
Re: SUID not working
sivakumr@rediffmail.com
regards,
U.SivaKumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2002 05:30 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2002 06:04 AM
12-12-2002 06:04 AM
Re: SUID not working
First, and probably easiest is to write a C wrapper. setuid(), setgid(), and system() will do just fine.
If you dont know any C, dont want to learn, etc...
Sudo may be able to handle all the switching. Sudo used in this way would be very difficult, but work for the most part.
Note: su -c only works on a single command, and you have the same limits for the command string length as any shell command.
Regards,
Shannon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2002 06:33 AM
12-12-2002 06:33 AM
Re: SUID not working
The one requirement that you may be missing is that the script MUST have as the first line:
#!/usr/bin/sh (or #!/usr/bin/ksh)
Take the simple example script...
(/tmp) # cat jp.sh
#!/usr/bin/sh
id
(/tmp) # id
uid=101(oracle) gid=102(dba)
(/tmp) # ll jp.sh
-rwsr-xr-x 1 root dba 18 Dec 12 14:19 jp.sh
(/tmp) # ./jp.sh
uid=101(oracle) gid=102(dba) euid=0(root)
Regards,
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2002 06:41 AM
12-12-2002 06:41 AM
Re: SUID not working
Not supported, probably will not work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2002 07:17 AM
12-12-2002 07:17 AM
Re: SUID not working
John, the behaviour you mention indeed *currently* works, but it is not documented and hence not supported (It *was* documented, and hence supported, in earlier releases.).
*Why* is it not/no_longer supported? Because set-UID (or set-GID) scripts are a security risk, because they *cannot* be made secure. I.e. you can plug many and perhaps even most, holes in them, but you cannot plug all holes. Because these holes are known, they pose a severe security risk. Hence a bad idea. Hence not supported.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2002 07:34 AM
12-12-2002 07:34 AM
Re: SUID not working
I agree with you, I was just pointing out that it *does* work.
Shannon,
The effective UID/GID is all that you can change with setuid and it's good for running most things - apart from those that actually check the real UID (LVM commands such as lvplit don't work with a EUID of root for instance).
Regards,
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2002 07:43 AM
12-12-2002 07:43 AM
Re: SUID not working
I understand what you are saying, however I think you underestimate the amount of applications that dont look at your effective uid, and only at your uid.
I find the easiest way to handle this type of situation is a 5 minute c-code wihch sets your uid, gid, and makes a system call to run your app. Then you dont have to worry.
Scripts can have a sticky bit, but only excecutables can be truly run suid.
Regards,
Shannon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2002 08:03 AM
12-12-2002 08:03 AM
Re: SUID not working
I understand what you guys are saying. I made this thing work on Solaris, but HP just wont accomodate this script in its current form. The SUID bit being ignored makes sense based on the results of my testing. It is a pretty ridiculous implementation that I wouldnt suggest. The problem is that we have several 3rd party apps that need to run their associated processes as different users.
A request was made to have one script that controls startup/shutdown of all apps.
I appreciate the good info that everyone has provided.
--Ben