macossublimetext3osx-elcapitan

Unable to save file without password prompt - Sublime Text 3


I'm having an issue all of sudden where I am being prompted on save for the password whilst in Sublime Text 3. I am working locally with Mamp Pro. The prompt message I get on save is:

    Sublime Text.app wants to make changes. Type your password to allow this.

If I don't enter the password I get this:

    Unable to save ~/Sites/mywebsite/templates/fl_sidebar/index.php
    Error: administrator_copy_file(/tmp/.sublba2.tmp,
    /Users/myusername/Sites/mywebsite/templates/fl_sidebar/index.php)
    failed: AuthorizationExecuteWithPrivileges failed: ffff159a

I've never encountered this error before at all when using Sublime Text so I don't know how to fix it. I had a look at this (How to give Sublime Text 3 write permission to files in web server's DocumentRoot?) and tried the non-command line options, but it did not alter anything.

I stopped running MAMP, checked all permissions on the folder by Get Info, which stated I have read & write privilege. I restarted the Mac and opened up my local development again in sublime, made a change and was instantly asked for the password again.

I'm on OSX El Capitan Version 10.11.2


Solution

  • It appears you do not have write permission to that folder for your user. You can change the ownership of the folder with the following command: -

    sudo chown -R INSERT_YOUR_USERNAME_HERE ~/Sites
    

    This will recursively change the ownership of all the files in the ~/Sites folder to your user. Once you have ownership sublime should work correctly again.