2

When I try to log in as root, it always shows the error like this. I tried to use apt install sudo and apt-get update but nothing has changed

enter image description here

Kusalananda
  • 320,670
  • 36
  • 633
  • 936
Onanigod
  • 21
  • 1
  • Can you check some files for root user as mentioned in the manual. `Run the shell specified by the target user's password database entry as a login shell. This means that login-specific resource files such as .profile, .bash_profile or .login will be read by the shell.` – Prvt_Yadav Dec 25 '22 at 12:00
  • ok, how to run that? – Onanigod Dec 25 '22 at 12:06
  • 1
    `getent passwd root`. The last `:`-delimited item in the list return from that command is the login shell for the root user. If it says `johny` then you have set the login shell of the root user to `johny` and this would be why you can't log in as root. Also, please never post images of text. – Kusalananda Dec 25 '22 at 12:09
  • Run `type sudo` if there is some alias or function defined... – Vlastimil Burián Dec 25 '22 at 12:13
  • it says sudo is hashed (/usr/bin/sudo), what does that mean? – Onanigod Dec 25 '22 at 12:24
  • @Kusalananda how do I fix that? – Onanigod Dec 25 '22 at 13:52
  • 1
    Related: [sudo su in bash error "Cannot execute help: No such file or directory"](https://unix.stackexchange.com/questions/422712/sudo-su-in-bash-error-cannot-execute-help-no-such-file-or-directory) – steeldriver Dec 25 '22 at 14:22
  • @steeldriver thanks, it finally works – Onanigod Dec 25 '22 at 14:45

0 Answers0