Instead of using the default Terminal emulator App, I want to open a Terminal Tab on the Chrome or Firefox Browser which I can do on Chromium OS (Crosh) but not on Ubuntu.
2 Answers
You can use node environment for it.
Then install web-terminal
npm install web-terminal -g
web-terminal --port 8088
just open that link in your browser:
http://localhost:8088/terminal/
You can add a new entry to startup applications to launch it automatically at startup.
gnome-session-properties
Open that window, name your entry and add the command in it or add the path of your bash script.
EDIT:
There are many alternatives, one of them I used in the past wetty You can search for them in github and nmp
EDIT2:
It's not a good idea to use a terminal emulator on your web browser. If you don't feel secure in your local network and you are not behind a firewall router, attackers may infiltrate in your operating system.
EDIT3:
Closing the assigned port to incoming connection attempts via ufw blocks accession to your computer from local network or internet.
sudo ufw enable
sudo ufw deny in 8088
Check out the status of your firewall:
sudo ufw status
- 5,074
- 12
- 55
- 94
-
1You can set any port number but it must not conflict with other open ports https://en.proft.me/2016/11/7/how-find-out-list-all-open-ports-ubuntuarch-linux/ – kenn Feb 16 '19 at 11:15
-
1You can add a new entry to startup applications to launch it automatically at startup `gnome-session-properties`. Open that window, name your entry and add the command in it. – kenn Feb 16 '19 at 11:52
-
4What I find a bit concerning about this suggestion is that software installed via `npm` as far as I know doesn't receive security updates when you run the usual `apt-get` commands to keep your system up to date with the latest security updates. And the software you suggest certainly is security critical. It's not that hard to imagine it could contain yet to be discovered bugs which under certain circumstances would allow any process running on the local machine to gain privilege escalation to your user account. – kasperd Feb 16 '19 at 17:27
-
14**WARNING: IF YOU RUN THE COMMAND IN THIS ANSWER, YOUR TERMINAL IS ACCESSIBLE TO THE WORLD!** Sorry for the yelling, but this is _really_ dangerous; by default, web-terminal listens on 0.0.0.0:8088, so anyone visiting yourip:8088 will get a terminal and can then execute any command as your user. You might as well attach a note "come in and take what you want!". (Also, I'm really no fan of `npm install -g randomsoftware`, installing unauthenticated unupdated software globally...) – marcelm Feb 16 '19 at 18:30
-
@marcelm I understand your concern. Nothing is 100% secure about web servers. It's an open source project in github https://github.com/rabchev/web-terminal. You can post the bugs you found over the issues tab. – kenn Feb 16 '19 at 19:07
-
12@kenn I'm not sure you understand the severity if this. As it stands, anyone following your advice _completely exposes_ their computer. This is not about "nothing is 100% secure", **this is about being 100% insecure**. Don't dismiss it with "you can file a bug". – marcelm Feb 16 '19 at 20:18
-
@marcelm Most people have their computers behind a router, meaning that no ports are open to the world... I'm not seeing the concern – A Gold Man Feb 16 '19 at 20:39
-
3@AGoldMan Enough users use public networks that don't enforce separation between on-network devices that this *is* an issue. Laptops and coffee shops/airports/random networks are common enough. That said, this project also doesn't work properly when processes interact with the PTY in slightly unusual ways, which is a functional deficiency imho – nanofarad Feb 16 '19 at 21:09
-
3@AGoldMan Can we please stop spreading the misconception that a router is a firewall. Also a firewall is never supposed to be your only layer of defense. – kasperd Feb 17 '19 at 08:38
I suggest using an ssh client in the browser. Either as a browser extension e.g. Secure Shell App, or an ssh client written in javascript.
There are other good posts in this topic: Is there a web based terminal/ssh client?
- 201
- 3
- 8
