Is it safe (no security implications) to chown -R user /opt/local/
, so that I don't sudo port install
with MacPorts?
I don't like the idea of sudoing with MacPorts as it can write things in /Library, for example, without my permission. I know I could use homebrew instead of MacPorts but I had problems with third-party software writing in /usr/local
. I could also compile MacPorts with a custom prefix in my home directory but I guess that is the same with /opt/local/
, as /opt/local/
is not a system directory.
Best Answer
If you want to use a non-root MacPorts installation you will have to configure your installation to do that by installing from source and specifying
--with-no-root-privileges
as argument to./configure
. Note that you might have to set--prefix
, too, if you want to do that.I would encourage you not to do that, for a couple of reasons, though:
/opt/local
/Applications/MacPorts
/Library/LaunchDaemons/
/usr/lib/pam
for PAM modules.So, in conclusion, I think a MacPorts installing using root privileges is actually safer and more secure than one not using them.
Disclaimer: Since I'm a MacPorts Developer, I might be biased.