I am trying to connect to my SSH server with a customized sshd_config file.
But when I try to connect, it gives the following error:
./bash: No such file or directory
And I copied bash to their directory including /bin, /lib64 and /lib.
These are the lines I added to sshd_config:
Match User cooluser
ChrootDirectory /home/cooluser
The /home/cooluser directory also exists.
>Solution :
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.