Bill Jonas on Thu, 13 Dec 2001 13:13:15 -0500 |
On Thu, Dec 13, 2001 at 12:13:42PM -0500, Naresh Reddy wrote: > Is it possible to write a script, so I can launch my internet connection > via Web-browser? In other words, is it possible to do 'sudo wvdial &' and > 'sudo route add default ppp0' using language like perl or c++ ? Well, you could certainly write a CGI script to do it, but it would need to run as root. I suppose it might not be too bad if you have only trusted machines on your network and firewall requests to that port coming in from outside your network. You can't use a shell script because Linux ignores the SUID bit on shell scripts for security. Actually, any scripted language. Perl can emulate the SUID bit by calling a special copy of itself which is SUID root. Or I suppose it might be possible to use sudo or su from a CGI shell script. Getting the password in there might be a bit of a problem; you can't just send the password in on standard input. You'd probably need to use the expect language for that. Yes, a small CGI with a password entry field, maybe radio buttons to tell it what you want it to do (dial, hang up) might work quite nicely. -- Bill Jonas * bill@billjonas.com * http://www.billjonas.com/ Developer/SysAdmin for hire! See http://www.billjonas.com/resume.html Attachment:
pgpIclB86DW1R.pgp
|
|