- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Help on sudoers and Runas_Alias
Operating System - Linux
1748259
Members
3652
Online
108760
Solutions
Forums
Categories
Company
Local Language
юдл
back
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
юдл
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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-27-2011 04:49 PM
тАО01-27-2011 04:49 PM
Help on sudoers and Runas_Alias
Hi All,
Thank you for your time. Request you to help with the sudoers issue I am facing.
I am trying to make use of Runas_Alias feature of sudoers. Some how I am not able to. Hope someone can help me. Thanks in advance.
I want the script /app2/run to be run as user "operator" when executed by the user engg. The /app2/run is just a sample script with "id" command in it for testing purpose. Anyways, here is the contents
Code:
$ cat run
#!/bin/ksh
echo "-----------------------------------------------"
id
echo "-----------------------------------------------"
In /etc/sudoers, I have the following entry
Code:
#
Runas_Alias OP=operator
engg ALL = (OP) NOPASSWD: /app2/run
I executed it using the -u option but no luck. I also tried giving the uid instead of username.
Code:
$ sudo -u operator ./run
sudo: unable to execute /app2/run: Permission denied
Is there anything I am doing wrong?
Here is my unix box version
Code:
$ uname -a
Linux flx1208 2.6.21_mvlcge510-pc_target-x86_em64t-Malban10-cge5 #1 SMP PREEMPT RT Thu Nov 18 07:12:50 CST 2010 x86_64 GNU/Linux
Normal sudoers works, I mean if I have entry like
Code:
engg ALL = NOPASSWD: /app2/run
And on execution
Code:
$ sudo ./run
-----------------------------------------------
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),4(adm)
-----------------------------------------------
Thank You,
Ahamed
Thank you for your time. Request you to help with the sudoers issue I am facing.
I am trying to make use of Runas_Alias feature of sudoers. Some how I am not able to. Hope someone can help me. Thanks in advance.
I want the script /app2/run to be run as user "operator" when executed by the user engg. The /app2/run is just a sample script with "id" command in it for testing purpose. Anyways, here is the contents
Code:
$ cat run
#!/bin/ksh
echo "-----------------------------------------------"
id
echo "-----------------------------------------------"
In /etc/sudoers, I have the following entry
Code:
#
Runas_Alias OP=operator
engg ALL = (OP) NOPASSWD: /app2/run
I executed it using the -u option but no luck. I also tried giving the uid instead of username.
Code:
$ sudo -u operator ./run
sudo: unable to execute /app2/run: Permission denied
Is there anything I am doing wrong?
Here is my unix box version
Code:
$ uname -a
Linux flx1208 2.6.21_mvlcge510-pc_target-x86_em64t-Malban10-cge5 #1 SMP PREEMPT RT Thu Nov 18 07:12:50 CST 2010 x86_64 GNU/Linux
Normal sudoers works, I mean if I have entry like
Code:
engg ALL = NOPASSWD: /app2/run
And on execution
Code:
$ sudo ./run
-----------------------------------------------
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),4(adm)
-----------------------------------------------
Thank You,
Ahamed
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-27-2011 10:21 PM
тАО01-27-2011 10:21 PM
Re: Help on sudoers and Runas_Alias
Hi,
$ sudo -u operator ./run
sudo: unable to execute /app2/run: Permission denied
This means operator user has no right to execute /app2/run file. Can you check the permissions of /app2/run?
Regards.
$ sudo -u operator ./run
sudo: unable to execute /app2/run: Permission denied
This means operator user has no right to execute /app2/run file. Can you check the permissions of /app2/run?
Regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-28-2011 02:21 AM
тАО01-28-2011 02:21 AM
Re: Help on sudoers and Runas_Alias
Hi,
Initially I didn't give permission for executing the script /app2/run for neither of the users - operator and engg.
I thought the below line in /etc/sudoers would give the permission for the user operator to execute the script
operatorALL = NOPASSWD: /app2/run
And this line would give the permission for the user engg to execute and associating the Runas_Alias will make it execute as the user operator
Runas_Alias OP=operator
engg ALL = (OP) NOPASSWD: /app2/run
But I guess I was wrong. Now when I gave the permission for the user operator to execute /app2/run, su -u operator /app2/run is successful when execute from engg user login.
I hope now my understanding is correct or if there is any different concept altogether?
Thanks a lot for the crucial clue :)
regards,
Ahamed.
Initially I didn't give permission for executing the script /app2/run for neither of the users - operator and engg.
I thought the below line in /etc/sudoers would give the permission for the user operator to execute the script
operatorALL = NOPASSWD: /app2/run
And this line would give the permission for the user engg to execute and associating the Runas_Alias will make it execute as the user operator
Runas_Alias OP=operator
engg ALL = (OP) NOPASSWD: /app2/run
But I guess I was wrong. Now when I gave the permission for the user operator to execute /app2/run, su -u operator /app2/run is successful when execute from engg user login.
I hope now my understanding is correct or if there is any different concept altogether?
Thanks a lot for the crucial clue :)
regards,
Ahamed.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP