16

I am converting an old laptop into what will basically just be a terminal for some of my other computers. For the most part, I only need to ssh into my computers, and that I can do with any CLI-based OS.

If that was all I needed, I would just install Debian and be done with it. But I also have a couple of computers that have built-in browser-based interfaces, such as a TrueNAS machine. I have a Fedora machine that has a "cockpit" also. I could install a desktop environment GUI, and simply open the interfaces in a browser, and in fact I do that currently and it works fine. But the whole desktop environment seems like way overkill for what I need.

So, what is the simplest/lightest/fastest way in which I can access a browser-based interface, but otherwise maintain as close to a CLI-only system as I can?

Valiant
  • 191

4 Answers4

35

I'd want to test out the actual apps I'd use before deciding. My highest common factor tool for accessing a web page over a terminal is carbonyl - I run the binary not the docker container, and the 'advantage' is even modern web pages work. And that tab you see on top is not my browser, it is my terminal window.

enter image description here

And it dosen't need a full DE as far as I can tell, its entirely framebuffer based

Its still a little work in progress - one needs to ctrl-c to close a window, no tabs, and its just got a barely functional address bar, but where it shines, it shines. You may also need a few additional steps, let setting up apparmor profiles on Ubuntu to get it running smoothly.

Journeyman Geek
  • 133,878
21

There is the option of using the text based Web browser Lynx.

enter image description here

Depending on the functions you need it may still work, though obviously images and potentially a lot of HTML5 and javascript features are out. If all you need to view text only websites then it may at least be functional.

An alternative modern option is Browsh which takes in proper webpages and renders them to text for display in CLI tools such as ssh. It is intended for low bandwidth situations, and requires a sever have a full desktop with Firefox installed, but the machine viewing it could conceivably be CLI only.

Mokubai
  • 95,412
15

the whole desktop environment seems like way overkill for what I need.

It's not. It's probably more efficient even for SSH than any alternatives (of which there aren't many), but it's pretty much the only option for browsers – practically all of them are X11 programs, so you need to run them on an X11 display server, which means running Xorg.

Keep in mind this is Linux – the actual desktop environment does not need to be full 3D-accelerated KDE or GNOME; you can manually assemble a basic environment that consists of a window manager such as Openbox (or twm or Fvwm if you want it to look more retro) and some Xterm windows.

Although these days, Linux uses kernel mode-setting for most (even old) graphics controllers, which means initializing Xorg takes less than a second as the GPU is already configured, unlike in the old days where Xorg itself had to do it from scratch. That is, it is quite possible to stay in the console most of the time and startx whenever needed, exiting Xorg when no longer needed.

However, I would not recommend that; the Linux kernel's built-in console is slow and inefficient (among other problems) and probably the worst choice there is for daily use. You'll have a much better experience SSHing from xfce4-terminal or Xterm or something such.

But in any case, the browser – not the rest of the GUI! – will be the most inefficient part. Modern browsers and webapps are large; you could try Ladybird as it's getting close to usable, but trying to load a massive JavaScript-driven GUI in modern Firefox or SeaMonkey will be probably 80% of your battery usage. Trying to do it in something else than Xorg won't really change much.

(I mean, you could probably go all the way with the "terminal" setup and use your laptop as a VNC terminal to connect to a browser running on another machine...)

grawity
  • 501,077
3

You can use another system that does have a GUI interface and browser, utilizing an SSH tunnel on the terminal system as a proxy. First, set up the SSH service/daemon on your terminal system.

The question isn't entirely clear about why you want to set up a CLI system to access your other computers, so it's plausible that you're connecting to it remotely, so let's assume for the sake of argument that this approach makes sense for your use case. If not, maybe someone else will find it helpful.

To do this, your client needs to support setting up forwarding. I'll use the SSH command-line utility as an example.

One option is to set up a single port for forwarding, like ssh -L LOCAL_PORT:HOST:HOST_PORT [USER@]SSH_SERVER, and connect your browser to http://localhost:LOCAL_PORT. For HTTP, you want port 80, and for HTTPS, port 443. Note that if it's HTTPS, the browser will reject the certificate for having the wrong domain name, but you may still be able to proceed anyway.

Alternately, if your client supports it, you can set up a SOCKS proxy using dynamic forwarding, like ssh -D LOCAL_PORT [USER@]SSH_SERVER. Then configure your system or browser to use that local port as a SOCKS proxy. Using this method, a browser will accept a valid, HTTPS certificate. Enter the original URL as you would enter it if browsing to it from the terminal system (the SSH host).

my browser proxy configuration

Corrodias
  • 487