- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Restricted command
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
Discussions
Discussions
Forums
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
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
тАО01-16-2009 10:10 AM
тАО01-16-2009 10:10 AM
So that the owner of the process (script
#ps -aef |grep scriptname) will be root
The script should run in the background.
Need ur help
Thanks in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-16-2009 11:16 AM
тАО01-16-2009 11:16 AM
SolutionRun this command to edit the sudoers file:
visudo
Add something like this (for 'user1' as example):
user1 ALL = NOPASSWD: /path/to/script.sh
Then in the user1 .profile, add this:
sudo /path/to/script.sh &
This will run the command as root in the background. For more information on sudo:
http://www.gratisoft.us/sudo/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-16-2009 11:16 AM
тАО01-16-2009 11:16 AM
Re: Restricted command
1) you want to run that during the login process
2) as "root"
3) in the background???
you might (and its not guaranteed to work), set the suid bits on the script in question and make the owner of the script "a" root. HOWEVER, in most cases, the OS will ignore suid on shell scripts (as I recall). AND, even if it works now, it might not in the future.
sudo should allow you to specify that *anybody* can run that specific script w/o requiring a password, and thus might be a viable option.
If you state what the goal of this, rather then how you intend to implement it, you might get better responses.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-16-2009 11:39 AM
тАО01-16-2009 11:39 AM
Re: Restricted command
I'll try it out, But regarding sudo, I am using Hpux9.0, & I dont have sudo installed
and dont know whether sudo is available/compatible for this verion of Hp-ux.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-16-2009 12:00 PM
тАО01-16-2009 12:00 PM
Re: Restricted command
http://www.gratisoft.us/sudo/install.html
and you could download the source code
http://hpux.asknet.de/hppd/hpux/Sysadmin/sudo-1.6.9p19/