Remove eject button from finder
Question
I accidentally ejected an external drive in the finder, is there an option to hide or remove/disable eject button from finder?
Solution
You can use the command below to edit the com.apple.finder preference.
defaults write com.apple.finder ProhibitEject true
that will set it for the current user, to set it system wide use
sudo defaults write com.apple.finder ProhibitEject true
The eject button will still show in finder but will not do anything when pressed.
OTHER TIPS
The easiest way, and suitable for ANY drive is to right-click the drive and choose "remove from sidebar". That way you can create an alias or navigate to your files from "{username}'s Mac" without messing with any other system configuration.
Licensed under: CC-BY-SA with attribution
Not affiliated with apple.stackexchange