./bash: No such file or directory

You are choosing to set up a chroot jail for the user that logs in. That means that you give that user his own private root directory, distinct from the system root. Accordingly, you will have to setup the interactive shell for that chroot environment. Among many other things, that involves having a /home/cooluser/bin directory. When logging in under that configuration, that directory is seen as bin because /home/cooluser has been set to be / with your chrootDirectory /home/cooluser statement.

You probably want to look for an easier solution, or read up a bit more about the approach you are taking now.


If you are intending to change directory, it should be cd ./bash. Otherwise it would just say if the directory exists or not (Or execute an executable file called bash if it exists). Also the ./ part of ./bash means that you are looking at the folder bash from your working directory. If you want the path from home use ~/bash instead.

Why are you copying bash to /bin and the other ones? I assume bash is preinstalled on Ubuntu based distros. It is the default one in the terminal.

I'm not familiar with SSH yet so I can't help with SSH configuration.