Run a script as any user
I have a script that displays the IP Address of a given network interface / device name.
I have placed it in /bin/ip.sh Code:
[root@mahadeva ~]# ip.sh eth0 Code:
[root@mahadeva ~]# su - DEV Any user can run ls command, for example, without any root privileges. I just found that my script and ls have identical ACL: Code:
[DEV@mahadeva ~]$ getfacl /bin/ls I looked at the visudoers file but got confused as to what entries I should make there (if that is a possible solution). |
You don't need privileges, you need to specify the path - /sbin/ifconfig - since 'command not found' means that it's not in your user's path.
|
Your problem is "command not found", ie ifconfig is not on the user's PATH. Use the full path (/sbin/ifconfig) in your script.
That will help. But if your script wants to do things that normally only root can do, that won't be enough. |
Quote:
|
chmod the script suid root. But are you really sure you want to do that?
|
Quote:
|
All times are GMT -5. The time now is 07:39 PM. |