- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: How to execute command in root as other user a...
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
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
тАО08-23-2006 01:56 PM
тАО08-23-2006 01:56 PM
To prevent disclosing root password to the operator, how to execute a command in root as other user account? Pls help. Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-23-2006 06:25 PM
тАО08-23-2006 06:25 PM
Re: How to execute command in root as other user account?
First:
execute visudo (tool that edits the /etc/sudoers file) and add appropriate entries- read man sudoers first.
then you'll have to prefix the commands with sudo:
sudo reboot (for example).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-23-2006 07:09 PM
тАО08-23-2006 07:09 PM
Re: How to execute command in root as other user account?
for more help pls. read man chmod
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-24-2006 01:55 AM
тАО08-24-2006 01:55 AM
Solutionoper ALL = (root) NOPASSWD: /path/to/your/script
This entry will allow the oper user, run without entering a password, the script specified.
You can create a better configuration with Aliases, this is the most basic entry.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-24-2006 01:51 PM
тАО08-24-2006 01:51 PM
Re: How to execute command in root as other user account?
/path/my_menu_script.sh
exit
I hope that when the operator exit the script, they will be automatically logout.
However, I found that a ctrl-c in the menu script can break the operator into a shell & allow them to key in command......
How can I restrict the access of the operator like this? Please help. Many thanks...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-25-2006 01:40 AM
тАО08-25-2006 01:40 AM
Re: How to execute command in root as other user account?
Try
trap exit 1 2 3
/path/my_menu_script.sh
exit
This will cause him to exit when he sends a signal 1 , 2 (ctl-C), or 3.
kill -l
gives a list of signals.
Or, if you have an exit in the menu, then you could use:
trap '' 1 2 3
a NULL command, which will just ignore the signals listed.
hth
bv
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-27-2006 10:31 AM
тАО08-27-2006 10:31 AM
Re: How to execute command in root as other user account?
For complete information, you can refer to this link,
The /etc/sudoers file contains all the configuration and permission parameters needed for sudo to work
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-27-2006 10:31 AM
тАО08-27-2006 10:31 AM
Re: How to execute command in root as other user account?
For complete information, you can refer to this link,
http://www.gratisoft.us/sudo/man/sudoers.html