Page 1 of 1

Changing IP Address on OS X via PHP

Posted: Thu Mar 17, 2005 1:40 pm
by mac_newbie
I am developing an application that requires the ability for an administrator to modify the server's IP address remotely through a web browser. The server is running OS X. I know that you can use a combination of shell_exec() and ifconfig to change the IP address, but the ifconfig command requires root access. At the command line you can use sudo along with a password, but I don't want to embed a sudo password in my script.

Does anyone have any recommendations? Is there a PHP command or script that someone has already completed to do this sort of app?

Thanks!

Posted: Thu Mar 17, 2005 2:17 pm
by feyd
why not require the administrator to supply the password when they wish to change the IP?

Don't want to give out the sudo password

Posted: Thu Mar 17, 2005 2:39 pm
by mac_newbie
That is a good idea, however the "administator" is only the administrator of the web app. I don't want to give out the sudo password for the entire OS. Are there any other methods other then using sudo to change the IP address on OS X?

Thanks!