9

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.

Crosh - The Chromium OS shell

9

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
  • 4
    What 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 at 17:27
  • 12
    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 at 18:30
  • 11
    @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 at 20:18
  • 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 – hexafraction Feb 16 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 at 8:38
5

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?

  • 1
    can you describe setting up Secure Shell App? – ifsanjry Feb 16 at 14:55
  • 1
    @ifsanjry I'm using Firefox. – Nyos Feb 17 at 21:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.