Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

./bash: No such file or directory

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.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

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.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading