If you’re using macOS Mojave as a developer, maybe you’ve come across the following problem when trying, for instance, to update your crontab or simply just moving files around.
crontab -e Cannot write to /tmp: operation not permitted
Perhaps you even read a couple of old solutions in Stackoverflow and elsewhere where you had to start your computer in recovery mode and do a bunch of stuff.
Well, I was at that place the other day when it hit me that all applications that I use on a regular basis like Dropbox and Keepass have alerted that in order to run OK you need to add an exception in the security settings.
The same goes for this problem. Make sure your terminal software (in my case iTerm2) is allowed Full Disk Access (see image below).
Voilá. Working in iTerm2 is now without hiccups again. No more operation not permitted when trying to access the /tmp folder.
NOTE! You need to click on the lock at the lower left in the image in order to get to add iTerm or Terminal to the Full Disk Access.