- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Shell Script using set-owner-id
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
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
08-25-2000 02:14 PM
08-25-2000 02:14 PM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2000 02:42 PM
08-25-2000 02:42 PM
Re: Shell Script using set-owner-id
The fact that files are created under the new owner demonstrates that the setuid is functioning. The fact that your other program does not accept the newid implies that it is using a form of authentication which bypasses a change of userid. If you su to the newuser does the program work? If not, it may be checking the logname rather than the active userid (who am i rather than whoami).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2000 03:03 PM
08-25-2000 03:03 PM
Re: Shell Script using set-owner-id
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2000 06:30 PM
08-25-2000 06:30 PM
Re: Shell Script using set-owner-id
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2000 04:30 AM
08-26-2000 04:30 AM
Re: Shell Script using set-owner-id
Alan Riggs is correct in stating that the problem is in the way that the target program is checking which user it is running as.
The suid technique changes the 'effective uid' of the process but not the 'real uid'. If the program checks the 'real' rather than the 'effective' uid then it isn't going to work. An example of this is the command 'lvsplit' which insists on being run as 'real' root, you can't run it from a root suid script.
One way around this is to have a 'daemon' process running as the required uid which communicates with your process (via signal or named pipe) and issues the required command or script. The security issues of this need to be considered carefully though.
Hope this helps,
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2000 12:37 AM
08-28-2000 12:37 AM
Re: Shell Script using set-owner-id
su -
in a script that is executed as user root.
This has also the advantage that the rigth environment is automaticaly set thru execution of profiles.
But if the initial script (the one executed as user root) is started by cron, you must beware of "terminal commands" (like stty and tset) in those profiles!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2000 05:56 AM
08-28-2000 05:56 AM
SolutionYou cannot use SUID to root on a shell script. HP recommends doing the following:
1. Create a simple C proigram that contains the calls you need to make. Call it setuid_shell.c
2. Compile the program using:
cc setuid_shell.c -o setuid_shell
3. Change the permission and set the user id by typing:
chmod 4777 setuid_shell
4. Change the owner to root by typing:
chown root setuid_shell
Now, the user can run this program as if they were the root user.
Tony
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2000 07:14 AM
08-28-2000 07:14 AM