- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Giving a shell script root priv
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
06-12-2002 09:37 AM
06-12-2002 09:37 AM
Thanks,
Mike
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2002 09:42 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2002 09:44 AM
06-12-2002 09:44 AM
Re: Giving a shell script root priv
Use "sudo".
You can download and install sudo from this link,
http://hpux.cs.utah.edu/hppd/hpux/Sysadmin/sudo-1.6.6/
Hope this helps.
Regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2002 09:45 AM
06-12-2002 09:45 AM
Re: Giving a shell script root priv
I don't know your particular situation, but are you sure you want to attempt this?
Is it not possible to just run the script as root, on a regular basis in cron, for example?
You are talking about opening up permissions to system device files as well as mount points.
Just my two pennies.
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2002 09:46 AM
06-12-2002 09:46 AM
Re: Giving a shell script root priv
You can script in the su command and have it pull the password from a file, but you have to be careful about security at that point. I think that there is a trick you can do to encrypt it, but I can't get on search to look for it.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2002 09:54 AM
06-12-2002 09:54 AM
Re: Giving a shell script root priv
I have a network of 4 identical boxes. I have an application that runs on this network. I need to be able to mount to the other three boxes at runtime. If a one or more boxes are down I don't want to attempt to mount them. I tried to mount the boxes to each other at boot but if one or more boxes are down then it takes up to 20 minutes to complete the boot. This is not an option. My application runs from a regular user account. My script pings the other boxes and based on the results mounts the ones that are up.
If anyone has a better way to to this please help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2002 10:00 AM
06-12-2002 10:00 AM
Re: Giving a shell script root priv
Also you could look into "autofs" or "automount" as a way to have these services mounted on a as need basis.
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2002 10:01 AM
06-12-2002 10:01 AM
Re: Giving a shell script root priv
http://docs.hp.com/cgi-bin/fsearch/framedisplay?top=/hpux/onlinedocs/B1031-90043/B1031-90043_top.html&con=/hpux/onlinedocs/B1031-90043/00/00/10-con.html&toc=/hpux/onlinedocs/B1031-90043/00/00/10-toc.html&searchterms=automount&queryid=20020612-110750
http://docs.hp.com/cgi-bin/fsearch/framedisplay?top=/hpux/onlinedocs/B9106-90008/B9106-90008_top.html&con=/hpux/onlinedocs/B9106-90008/00/00/43-con.html&toc=/hpux/onlinedocs/B9106-90008/00/00/43-toc.html&searchterms=automount&queryid=20020612-110750
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2002 10:02 AM
06-12-2002 10:02 AM
Re: Giving a shell script root priv
Mike
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2002 10:28 AM
06-12-2002 10:28 AM
Re: Giving a shell script root priv
There is a "dirty" way to achieve what you want, and I would be very careful of where, what and how you use it. It works in most cases. Establish your script as a 'setuid' script. Consider the script below. You must have the interpreter declaration as shown.
#/usr/bin/sh
/usr/sbin/mount /dev/vgXX/lvolY /mymountpoint
exit 0
Call the script 'mymount.sh' and do:
# chown root:dba mymount.sh
# chmod 4110 mymount.sh
Now, members of the group *dba* can execute the script, but only 'root' can read or write (modify) the it.
To further secure this script, place it in a directory whose sticky bit is set. This prevents non-owner's (here, root) from deleting it.
Regards!
...JRF...