Chown to make sudo unncessary?
The tool chown
isn’t good for this. Instead use sudo -s
to be root. Now you’re the owner of the root directory.
If you want to ask a follow on question showing a specific path and specific command you get a specific error, there might be a better way to set things up - root won’t help with system read only files and the restricted flag in System Integrity Protection. Also, avoiding root entirely or adding your user to the sudoers file for the things you need also will get you less friction without tearing down all the protections of using a non-root user provide.