I deleted the /etc/ folder and it is now in Trash.
I cannot put it back as it needs permission, and when sudo asks for the password, I enter and it doesn't work (as everything seems was in that etc).

Now I cannot even login into my machine.

How can I put that etc folder back to the /private/HERE folder?

I have access to Terminal through Recovery Mode. The Users/ only shows the Shared folder and not my user.

  • As a user how did you remove /etc? or do you have admin access on your user account?
    – Solar Mike
    Commented Jul 15, 2022 at 8:40
  • By sudo it was possible, unfortunately!!!
    – Dr.jacky
    Commented Jul 15, 2022 at 8:41
  • So you already had SIP disabled?
    – nohillside
    Commented Jul 15, 2022 at 11:02
  • @nohillside No, it is enabled. csrutil status -> System Integrity Protection status: enabled.
    – Dr.jacky
    Commented Jul 15, 2022 at 11:53
  • Ah, would have assumed that at least /etc itself is under SIP. Oh well.
    – nohillside
    Commented Jul 15, 2022 at 13:00

1 Answer 1

  • Boot into Recovery Mode
  • Open the Terminal from Recovery menu
  • Type chroot "/Volumes/Macintosh\ HD" zsh
  • Type mv /Users/[yourusername]/.Trash/etc /private
  • Restart
  • 2
    You can skip the chroot step by running cd /Volumes/Macintosh\ HD/; mv Users/[yourusername]/.Trash/etc private/ directly.
    – nohillside
    Commented Jul 15, 2022 at 11:04

You must log in to answer this question.

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