I can't find the command in sudo When I tried to set the root user's path by su, it was rejected so I checked
When I switched from bash to zsh ~~ Did the default shell of root become / usr / local / bin / zsh by mistake ~~, it seems that the cause is that the root shell is not set in the first place
I haven't set the root path, so I can't set the root shell with chsh! </ font>
Actual path
❯ echo $SHELL
/usr/bin/zsh
sudo chsh root -s /usr/bin/zsh
sudo chsh root -s /usr/bin/zsh
chsh: PAM:Authentication failure
Edit /etc/pam.d/chsh
so that you can change the shell.
#
# The PAM configuration file for the Shadow `chsh' service
#
# This will not allow a user to change their shell unless
# their current one is listed in /etc/shells. This keeps
# accounts with special shells from changing them.
#Comment out here
# auth required pam_shells.so
You can change it by doing sudo chsh root -s / usr / bin / zsh
again in this state.
If you can change it, undo the commented out line.
$ sudo su -
$ passwd root
Please enter a new UNIX password: xxx
Please re-enter your new UNIX password: xxx
passwd:Password updated correctly
$ exit