Reputation: 67
I have an executable file with .sh extension. I want to open this file through firefox with Terminal but it return an error:
"filename.sh" can't be opened because Firefox is not allowed to open documents in Terminal.
now, how can I change the permissions to resolve this out?
Upvotes: 3
Views: 5289
Reputation: 294
A more secure method working in all modern browsers with javascript can be found here:
Install the websocketd server (single static linked binary) download from http://websocketd.com/
Start the websocketd server:
./websocketd --port=8080 --devconsole ./command.sh
Write an HTML page and a small bash script
HTML:
<button type = "button"
onclick = ws.send("xterm\040#started")>xterm </button>
Javascript open a websocket:
var ws = new WebSocket('ws://localhost:8080/');
Bash script(command.sh):
#!/bin/bash
export DISPLAY=:0.0
while read command
do
eval $command
done
more details: http://www.bitkistl.com/2016/01/websockets-with-interactive-bash-script.html
Upvotes: 1
Reputation: 54563
It is normally disabled because it can allow malware to damage your files. For instance this STIG Viewer topic Network shell protocol is enabled in FireFox.
However, it is configurable, called the "Shell Protocol". The blog entry Firefox: Enable starting of scripts and applications from an HTML page goes into some detail, showing settings for
Upvotes: 0