Connecting Terminals to Untrusted Servers

I recently thought about risks when connecting to an untrusted SSH server. For example a badly maintained server you’re supposed to do work on. This is what I came up with.

This is made with SSH in mind. But it may also apply to other methods of connecting terminals like serial connections or Telnet.

Using Wayland would be a benefit here. But it would need another terminal application instead of xterm. And for the moment I’m still an X11 person.

#!/bin/bash

# License: AGPLv3


SRV_ADDR="${1}"
# e.g.: '-p50022 root@127.0.0.1'

LC_ALL=C setsid --fork xterm \
  -xrm 'XTerm*allowTitleOps: false' \
  -xrm 'XTerm*allowFontOps: false' \
  -xrm 'XTerm*allowTcapOps: false' \
  -xrm 'XTerm*allowColorOps: false' \
  -xrm 'XTerm*fontDoublesize: false' \
  -xrm 'XTerm*allowMouseOps: false' \
  -xrm 'XTerm*VT100.translations: #override Ctrl Shift C: copy-selection(CLIPBOARD) \n'\
'Ctrl Shift V: insert-selection(CLIPBOARD)' \
  -fn 9x15 \
  -maximized \
  -e 'bwrap '\
'   --unshare-all --share-net --die-with-parent '\
'   --ro-bind /usr /usr '\
'   --symlink /usr/lib /lib '\
'   --symlink /usr/lib64 /lib64 '\
'   --ro-bind /etc/ld.so.cache /etc/ld.so.cache '\
'   --ro-bind /etc/resolv.conf /etc/resolv.conf '\
'   --ro-bind /etc/passwd /etc/passwd '\
'   --dev /dev '\
'   --dir "${HOME}/.ssh" '\
'   --ro-bind "${HOME}"/.ssh/id_ed25519_untrusted-server '\
'     "${HOME}"/.ssh/id_ed25519_untrusted-server '\
'   --clearenv --setenv HOME "${HOME}" --setenv TERM "${TERM}" -- '\
'     ssh -i ~/.ssh/id_ed25519_untrusted-server '\
'     -F /dev/null -ax -o SetEnv=LC_ALL=C '\
'     -o PasswordAuthentication=no '\
'     -o KbdInteractiveAuthentication=no '\
'     -o UpdateHostKeys=no '\
'     '"${SRV_ADDR}"' || cat'
# no extra quotes around SRV_ADDR to expand it

How to compile LibreOffice Windows builds for Unix nerds

I recently needed to compile LibreOffice for Windows. And LibreOffice is relying on the MSVC compiler for that, so the straightforward way is to boot up a Windows.
If you have a nice howto for running Visual Studio under Wine / CrossOver / Proton, feel free to send me a link 😉
I’ve heard there used to be MinGW support. But it was dumped because it was ABI incompatible and maintaining two build setups was too much work.

Since I mostly work on Debian GNU/Linux since many years, I had quite some aversion clicking trough Windows setup wizards. I’m trying to keep this howto as short as possible. So here’s the solution I ended up with. Weiterlesen →

VRAM and Memory for Integrated Graphics with Linux

I got two HP EliteBook notebooks with a Ryzen CPU, featuring an integrated GPU (AMD term „APU“). The BIOS offers a setting to configure the VRAM between 256 MB and 2048 MB on the one, 512 MB on the other notebook. So I wondered what happens when the GPU required more than the dedicated VRAM. There is some information about what happens on Windows in the WWW. But I like my Linux system, so I spend some time finding out what’s happening there. Weiterlesen →

User Mode Linux (UML)

UML (User Mode Linux) is a nice way for Linux virtualization. Somewhere between containers and full or paravirtualization. But without actually using a visualizer / hypervisor.

Unfortunately UML not so well documented. So I dumped some of my notes here.
Weiterlesen →

Ein Cubieboard 2 (A20)

Mein neuestes Spielzeug ist ein Cubieboard 2 mit A20-ARM Prozessor.
http://cubieboard.org/2013/06/19/cubieboard2-is-here/
https://de.wikipedia.org/wiki/Cubieboard
Nicht zu verwechseln mit dem Cubieboard (ohne 2) mit A10 Prozessor. Der Unterschied Cubieboard (A10) zum Raspberry Pi (Model B mit 512 MB RAM) ist eher gering (bis auf dem SATA-Anschluss des Cubieboards).
http://www.raspberrypi.org/faqs
Das Cubieboard 2 (A20) hat aber einen DualCore-Prozessor und 1 GB RAM (und ebenfalls SATA). Neben dem Cubieboard 2 wird es demnächst wohl auch den noch leistungsfähigeren Cubietruck (2 GB RAM) geben. So lange wollte ich aber nicht warten.
http://cubieboard.org/2013/09/14/cubietruck-is-put-into-trial-production/
Weiterlesen →

Hardware für Linux

Wer ein Linux-Notebook oder -Computer hat steht immer mal wieder vor der Frage: Welche Hardware soll ich mir kaufen, damit Sie gut mit meinem Linux funktioniert. Eine Hilfe bei diesem Problem soll der folgende Artikel geben. Weiterlesen →