Table of Contents

SSH User Jail mit Docker Containern

Die Basis

Ziel

Ziel war es eine User Shell mit folgenden Eigenschaften zu erschaffen:

Wer ausschließlich chroot SFTP braucht, sollte die OpenSSH Features nutzen. :P SFTPGo ist ein gutes Tool für SFTP chroot mit vielen anderen Features, welche wir hier aber nicht brauchen. Wir nutzen ausschließlich das SFTP subsystem davon, weil das standardmäßig ein virtuelles chroot für den User erzeugt.

Was ist das Problem mit den OpenSSH's eigenen Features?

SFTP-only ist seh einfach und cool, aber chroot für eine interaktive Shell ist schmerzhaft.

Nachteile:

Warum nicht rssh?

http://www.pizzashack.org/rssh/ - Stand vom September 2023:

Sadly RSSH died a horrible death in 2019 when it became clear that providing restricted access to arbitrary programs is nearly impossible, particularly without being extremely expert in all of the programs involved (including sshd and all of the applications you wish to restrict). This proved to be an unmanageable task, and support for RSSH ended with unpatched (and I believe unpatchable) security issues, not entirely the fault of RSSH itself.

Containerisierte Variante

Vorteile

Nachteile

Man verliert einige OpenSSH Forwarding-Features (Ports, Keys, …).

Is this solution secure?

Keine Ahnung. Ich hoffe es. :-P