I have a problem. I have 2 users user (normal user) and admin (admin user). I normally work on user user and when I wanted to update some files (as for example /etc/hosts) I did:

$ su admin
$ sudo nano /etc/hosts

However from some time (probably from update to MacOS Catalina). It's not working anymore.

I can switch to admin user (1st command) however when I try to run 2nd command I'm getting message "sorry" although I'm 100% sure I type valid password (I copied this password to text editor and pasted this password to 1st command and it's working fine but it doesn't work for 2nd command).

  • Are you running sudo from your normal account or after running su admin?
    – nohillside
    Commented Dec 1, 2019 at 12:38
  • @nohillside As I explained I'm running it after 1st command so after switching to admin user Commented Dec 1, 2019 at 14:49

2 Answers 2


It seems the solution was after running 1st command to run:

sudo -s

Somehow it fixed situation and now again both commands are working without any problem as they did before. Hard to say what was the reason for this (maybe introducting zsh) but now I can again edit files I need

  • Many thanks Marcin for your answer! Really unexpected this actually works! I can't do "sudo xxx" command, but I can do this to give me root shell...
    – Kevin Liu
    Commented May 17, 2022 at 14:43

Restarting the Mac helped me. It's not so obvious, comparing to Windows. A lot of people do not switch it off or restart at all, just closing the display.

  • For me it was not helping as far as I remember but I restart Mac about once a month Commented Feb 18, 2020 at 15:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .