MAC OS  - folder permissions

AVL_IT
AVL_IT used Ask the Experts™
on
i need to copy a mib file which i have downloaded onto my desktop.  when issuing the following command and enter the prompted password it says operation not permitted.  


MacBook-Pro:Desktop bryantotten$ sudo cp AIRESPACE-REF-MIB.my /usr/share/snmp/mibs/
cp: /usr/share/snmp/mibs/AIRESPACE-REF-MIB.my: Operation not permitted

thanks for any assistance you can provide
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Gerwin Jansen, EE MVETopic Advisor
Most Valuable Expert 2016

Commented:
/usr/share is part of System Integrity Protection - https://en.wikipedia.org/wiki/System_Integrity_Protection

The message you get means indeed that you have no permission to copy files into the /usr/share/snmp/mibs folder.

There is a way to disable System Integrity Protection but that is not advised. Why do you need to copy a file to that location?

Author

Commented:
Gerwin-

thanks for the response.  i am working on a script which calls netsnmp.  this script will be a network management tool for cisco devices.  the mibs that come with the mac os do not include the cisco mibs, which is why i need to update.  

i understand your concern in writing to this file location, however i am not coming up with a good workaround.

thanks!
Topic Advisor
Most Valuable Expert 2016
Commented:
Then you need to (temporarily) disable SIP, the procedure is here:

https://developer.apple.com/library/content/documentation/Security/Conceptual/System_Integrity_Protection_Guide/ConfiguringSystemIntegrityProtection/ConfiguringSystemIntegrityProtection.html

Recommend you have an up to date Time Machine backup before you start.

Author

Commented:
that worked.  thanks!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial