Interactive Linux login environment in App

fa2k

Dabbler
Joined
Jan 9, 2022
Messages
34
I'd like an App where you can log on using SSH and get a command line, with a small set of software installed (or just a bare Ubuntu). Have anyone successfully implemented this? I don't even need a persistent storage for this container, it could mount /home on the NAS storage and software could be managed by conda or similar. The challenge is how to make a docker image or chart that allows public-key SSH login with a given UID, and run this on a dedicated IP address.

It would be like a VM, but the advantage* of using a container would be to have access to the full CPU and RAM resources of the NAS hardware, and direct access to the storage using a bind mount (instead of running NFS over a virtual NIC, which introduces a lot of inefficiencies). Compounding this, if I use a VM and dedicate 16 GB to it, the RAM used by Services seems much higher - close to 32 GB.
(* In other cases it could be a disadvantage to use the full resources)

It's not exactly the intended usage, I get that it's a bit hacky thing to do - hope you consider sharing experience or tips anyway.
 
Joined
Oct 22, 2019
Messages
3,641
Something like this?


 

fa2k

Dabbler
Joined
Jan 9, 2022
Messages
34
Thanks for the pointers winnie, exactly like that. I didn't think to search for that, but now there's yet another set of search terms that point to these threads :)
 

fa2k

Dabbler
Joined
Jan 9, 2022
Messages
34
After a lot of work I found a solution for me. I don't think it applies to the other threads though - it will be different in each case. I made a docker image based on Ubuntu, with an SSH server that can be used by a single user - https://github.com/fa2k/dockerfiles/blob/main/my-login-node/Dockerfile
It's probably not a good idea for others to use this directly, so I don't share my docker hub URL. Note I take great care to make sure the host keys are not in the docker image, to prevent man in the middle attacks.

I first tried the image from Linuxserver.io (which I generally like) https://hub.docker.com/r/linuxserver/openssh-server
I wasn't able to run the binaries I had from other systems. It probably uses a quite special base image, that doesn't support the same glibc version or what ever.
 
Top