View Full Version : executing commands on a Linux box via Javascript

01-25-2012, 05:33 PM
I have been using Perl code for about 15 years and I develop/support Perl code used by engineers who run this code in Linux terminals. The code uses Tk as the user interface, which in turn executes Perl scripts.

We are looking into the possibility of putting the user interface in a web browser, which would (somehow) still run the same scripts on a Linux box.

I can write a Perl script that, given a Linux machine name, user name and password, can open a connection to that machine and execute anything on that machine.

My question: Can this sort of thing be done via a web page? This is posted in the JS forum because JS seems like it would provide the tools to create the type of interactive user interface I require.

(I don't know a thing about JS, at the moment I'm trying to decide which language to use to implement my s/w, but first I need to determine if the language can do what I need.)

01-25-2012, 08:58 PM
Web pages have no access whatsoever to the operating system. If they did then your computer would rapidly become unusable because of the millions of viruses that such pages would install. You'd also be bankrupt because such pages would also have stolen all your personal details and used that information to transfer everything you own to someone else.

That web browsers do not permit pages to access the operating system is your first line of defense against these things happening - as without this your security software would be immediately compromised by scripts that can't be blocked without completely blocking access to the web or at the very least considering JavaScript itself to be a virus and treating it accordingly.

JavaScript running outside of the web browser can have access to do what you want but will not have access to the web.