Saturday, May 4, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 669  / 3 Years ago, wed, august 4, 2021, 3:15:36

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.


More From » bash

 Answers
6

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.


[#924] Thursday, August 5, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
atereress

Total Points: 79
Total Questions: 106
Total Answers: 119

Location: Federated States of Micronesia
Member since Sun, May 16, 2021
3 Years ago
atereress questions
Sat, Apr 16, 22, 17:34, 2 Years ago
Thu, Dec 22, 22, 05:56, 1 Year ago
Sun, May 15, 22, 15:59, 2 Years ago
;