So this morning I tried to login into my root and I got an error saying:

su: failed to execute q: No such file or directory.

In /etc/passwd everything seems to be normal.

Tried logging in through:

su -s /bin/bash username

It doesn't show me the error like in the previous example, but It just returns me to normal user, instead of root.

Has anyone encountered this problem before? Thank you in advance!

  • 3
    Check the shell startup files for root's login shell. It seem to want to execute something called q somewhere. – Kusalananda Nov 7 '19 at 8:24
  • Checked them, everything seems to be normal. Any other suggestions? – joniop Nov 7 '19 at 8:31
  • Check again, that q has to be somewhere, in /etc/profile, /etc/bash.bashrc, /root/.bashrc, /etc/profile.d/, ... – SYN Nov 7 '19 at 8:42
  • Think I found something in /etc/passwd [root:x:0:0:root:/root:q] I guess this is not how the root should look like. Any idea how to edit it when I am not root? – joniop Nov 7 '19 at 8:44

Okay, so after twinkering with the system, I managed to get it running.

This is what I did:

  1. Entered in recovery mode (I am using VM)

  2. From then, I opened nano /etc/passwd (I dont know why it let me edit it, because It still wouldn't let me enter my password). I will be thankfull if someone explained that to me.

  3. Root access queired to something q: (which was just like the error that it showed me)

  4. Made the root to /bin/bash

  5. Saved the changes and everything was fine. Now I am able to enter my password and enter root.

Thanks to everyone that contributed. :)

  • 1
    Recovery mode or single user mode usually requires physical access to the machine. With physical access, you are not required to give a root password (because the password would not protect the system from physical tampering anyway). – Kusalananda Nov 7 '19 at 9:26
  • Okay, that says it all. Thank you alot, It was very helpfull. :) – joniop Nov 7 '19 at 9:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.