
I recently came across this article on Tecmint, which describes ttyd, a nifty program to make the Linux shell available remotely over the Internet.
I played around with it a bit and was delighted to see ttyd can be configured to request username and password from the client and provides an https channel if you supply keys and a certificate. While a relatively recent version can be installed directly from the Debian / Ubuntu repository in recent OS versions, the latest version is available as source or binary on Github. I tried installing all three variants in a test VM and even compiling from source worked without much trouble.
Overall, ttyd pretty much works as advertised, and I couldn’t detect any additional lag of the shell in the browser compared to a remote ssh shell. Also, mouse interaction, e.g. with tmux to resize frames work as in a plain ssh shell, and ncurses programs like htop just look like as they should as well. Even copy and paste to and from the shell in the browser worked!
For my production systems, I don’t see a need for such a setup, but for doing Docker and Kubernetes learning sessions, this might offer a significant simplification compared to my previous setup with Guacamole. Instead of one small virtual machines per participant, one big VM with one user account per participant might be enough. Such a setup would be much easier to instantiate and configure. For this to work, however, I would need a ‘rootless Docker’ setup and MiniKube to work without root as well. Let’s see if I can get that set-up as well.