Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 08-05-2010, 09:30 AM   #1
Registered: May 2009
Location: India
Distribution: On my PC I use RHEL, at office AIX, Solaris, HP-UX, RHEL.
Posts: 254

Rep: Reputation: 18
Automating Linux Administration through Web Interface


The question that I am posting here is quite interesting as it was asked in the interview I attended today. And, honestly, I could not provide a solution.

Ok, here goes the problem statement:

Design a Web Interface that has three text fields:

IP Address:
Subnet Mask:
Default Gateway:

And a button:


When we click the Submit button, the two entries must be set in the concerned files and then the network service must be restarted to bring the new IP Address, Subnet Mask, and Default Gateway in effect.

As we all know that these settings can be done by the root user or a user who has those priveleges.

So, finally, how can we achieve it?

The complete web interface needs to be done only in PHP. Some Shell Script can be used if required.
Old 08-05-2010, 06:46 PM   #2
Registered: Aug 2008
Location: Denmark
Distribution: Ubuntu
Posts: 58

Rep: Reputation: 18
One method, is to make a shell (bash) script to do it, and put it in sudoers, so that the web service can execute it.

I have a few of these "root scripts" that works just fine.

An example on ubuntu, in /etc/sudoers:

www-data ALL=NOPASSWD: /www/

This allows me to run "exec('/usr/bin/sudo /www/')"
in PHP as root.


exec, php, sudo

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Intro to Automating System Administration with Cfengine 3 LXer Syndicated Linux News 0 06-08-2010 11:20 PM
Automating database web search Phyrexicaid Programming 6 04-09-2008 07:17 AM
linux system administration including network administration linux_linux Linux - Hardware 3 03-15-2008 11:07 PM
web interface contorl Linux leiw Linux - Newbie 2 12-24-2006 03:32 AM
CUPS web-administration interface on SuSE 9.1 LUB997 Linux - Hardware 1 03-09-2005 03:16 AM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:26 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration