Fix permissions in /tmp folder for mac

Problem:

I messed up my /tmp folder permissions 

OS details

mac details

Solution:

Follow the below steps to get it resolved.

  1. Reboot your Mac into recovery mode
  2. Open Utilities menu in the top bar > open Terminal

    csrutil disable
    
  3. Reboot

  4. Remove the tmp folder

    sudo rm -i /tmp
    sudo rm -r /private/tmp
    
  5. Create tmp folder

    sudo mkdir /private/tmp
    sudo chown root:wheel /private/tmp
    sudo chmod 1777 /private/tmp
    
  6. Create the symlink

    sudo ln -s /private/tmp /tmp
    
  7. Reboot back to recovery mode and run

    csrutil enable
    
  8. Reboot

The above steps will fix the problem for you.