I can't login to root on VPS server. But login to usual user is successful. I've tried to login username and after that change to root by commands su - root and su -. These commands fail after successful password attempt with message "Cannot execute username: No such file or directory" where username my current username.
I think that error come after my try change username login access with chsh command (something like chsh --shell /bin/sh username). There is no sudo access on my user. What can I do solve this problem?

  • @Kusalananda su - either didn't help. Failed with same message – Axbor Axrorov Oct 15 '18 at 18:40

Try this solution:

su -s /bin/bash username

From man su:

-s, --shell=shell

Run the specified shell instead of the default. The shell to run is selected according to the following rules, in order:

  • the shell specified with --shell

  • the shell specified in the environment variable SHELL, if the --preserve-environment option is used

  • the shell listed in the passwd entry of the target user

  • /bin/sh

Update: Try to check is you have valid /etc/passwd file.

|improve this answer|||||
  • didn't help. nothing changed – Axbor Axrorov Oct 15 '18 at 19:12
  • @AxborAxrorov Try to check is you have valid /etc/passwd file. – Ivan Gurzhiy Oct 15 '18 at 19:23

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.