I am looking for some help on how to dockerize user sessions in Linux. What I am looking for is how would I make it so when someone ssh's into an account and does anything, when they exit anything they did isn't saved; it's how I have it set up next time someone else ssh's into it.
It's for a CTF event I've been tasked with setting up and with really no knowledge of most of what I have to do this whole process is a learning experience for me.
A good explanation of how I am hoping to have it set up is explained here: http://overthewire.org/help/sshinfra.html
So you can do that by creating a new docker based shell for the user
Creating the user
First we create the user using below command
Creating the shell
Next create a shell file
/usr/local/bin/dockershell
And then
chmod +x /usr/local/bin/dockershell
. Now you can ssh to your vm with the new userThis takes me to the docker container and no session changes are saved. If you want to secure it even more, you should be user namespace remapping
https://success.docker.com/KBase/Introduction_to_User_Namespaces_in_Docker_Engine
That is because the writable layer of a container is discarded when the container stops.
You should make sure your container is run with a bind mount or (better) a volume: that way, the modification done during the ssh, if done in the right (mounted) path, would persists.