0

When I look up this particular error on the web, every single one of them are in regards to shell scripts. I keep getting this error in the terminal itself and my home server is completely unusable without booting into rescue mode because of this. The login screen is bugged and does not respond to the correct or incorrect password. The boot shows numerous [ FAILED ] lines as well.

This had begun when I had configured a particular user with a "chroot jail" and set to rbash and I have unfortunately lost the lines of code that went along with me configuring it that had led a complete disaster upon reboot.

When I send a command in rescue mode, such as "ldd /usr/bin/bash", it will return the error. However this does not occur with some basic commands (perhaps it's stuck on /bin/sh? "$SHELL" returns /bin/sh in rescue mode)

ldd /usr/bin/bash
bash: /usr/bin/ldd: /bin/bash: bad interpreter: No such file or directory

HOWEVER. I found out if I precede the command with bash, it will return it correctly! Such as "bash ldd <options"

bash ldd /usr/bin/bash
<relevant correct data>

It's very strange. I have set every users shell to /bin/bash but that does nothing. I am relatively new to home servers and had the knowledge to make a few basic scripts and set them to crontab or whatnot and be able to ssh from outside the network. But unfortunately I was not entirely knowledgable on the chroot jail set up and underestimated the havoc it could cause. I had followed this tutorial and had gotten to the point of copying the libraries to the jailed user when I had realized that this had made my server dysfunctional on reboot. I again apologize for no logs as I had not anticipated such and had not copied and pasted what exactly had been done.

Thank you.

4
  • 1
    /bin/bash is different to /usr/bin/bash - maybe you can fix this by "ln /usr/bin/bash /bin/bash " but its hard to know if/ how you have munted your system in the persuit of setting up a jail. (if the problem is for a jailed user /bin/bash is relative to the jail...)
    – davidgo
    Jun 8, 2022 at 8:02
  • Thanks for the response! The problem seems to exist for all users unfortunately. I had tried ln /usr/bin/bash /bin/bash but had gotten the following response. ln: failed to create hard link '/bin/bash' => '/usr/bin/bash': No such file or directory. ---- There was another comment on this post that might've gotten deleted as I do not see it anymore but I had done the following ls -ld /bin /usr/bin/bash /usr/bin/bash /usr/bin/ldd /lib /usr/lib everything seemed normal except: ls : cannot access '/bin': No such file or directory But bin does exist in /usr/local/bin. Jun 8, 2022 at 16:54
  • One more thing: /usr/bin/bash also exists. Jun 8, 2022 at 17:05
  • Apologies if this is considered spam. But I have gotten a strong clue that /bin has an issue with a symlink as it is not pointing towards usr/bin. I believe what should occur with ls -ld /bin is lrwxrwxrwx 1 root root ? (month) (day) (time) /bin -> usr/bin This is what I get on a correct set up. But my broken server is only responding with: ls : cannot access '/bin': No such file or directory I don't know how to solve it. Jun 8, 2022 at 19:21

1 Answer 1

0

Solved.

It was simply a broken symlink in regards to bin. Thank you davidgo for pointing me in the right direction, it was not bash but rather the bin I guess. A different user had also commented about this but it had been deleted, thank you to whomever it was as well.

Fixed with:

ln -s usr/bin bin

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .