So, I've been trying to install zsh. It didn't work properly, after terminal restart, so I decided to change the shell again by typing chsh -s /bin/zsh, once again, but accidentally preceded that with sudo. Now if I type sudo 'anything' or su -, there appears an empty new line, with nothing I can do (nor the Ctrl+C nor the Ctrl+D do not help). What can I do to restore everything back to default? This is MacOS X 10.13

  • Could you post, please, output of the command: echo $SHELL – Bob Jul 23 '18 at 6:58
  • @Bob it’s /bin/bash – Egor Alimpiev Jul 23 '18 at 8:46
  • @Bob the user’s shell is okay. it’s the sudo that does not work, after trying all commands from the answer. I’ll try to post the picture – Egor Alimpiev Jul 23 '18 at 8:55
  • @Bob sorry, the computer is not mine, so no proper screenshots. imgur.com/vjiMl5J – Egor Alimpiev Jul 23 '18 at 9:00
  • OK, I see. My answer below is useless, I'm hiding it temporarily. Please, execute sudo date, press Enter key and wait up to 10-15 minutes. Has the password prompt appeared with some delay? – Bob Jul 23 '18 at 10:40

Adding sudo to your command should cause no problems unless the command was initially forbidden. The chsh command wants a password anyway. Using sudo may change the root shell but sudo should still work as before. If you are having problems I'd close the terminal and open a new one.

  • chsh won't ask for a password if you're running as root. – roaima Jul 28 '18 at 21:53
  • yea sorry.. i should have included that. – jmh Jul 28 '18 at 22:11

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.