18

I updated to Mac OS Lion and now every time I delete any file it asks me for my password. Any file - be it on the Desktop, in the Downloads folder or in any other place. It asks me for my password every time.

That behaviour is annoying. Is it the new default? Or there is something wrong?

Edit:

For example: this file, which is located on the desktop.

➜  Desktop  l | grep terminal
-rw-r--r--@   1 Nerian  staff   841913 22 jul 14:16 terminal.png

Edit:

Seems that quite a lot of people are having the same issue:

https://discussions.apple.com/thread/3199093?start=0&tstart=0

https://discussions.apple.com/thread/3197928?start=0&tstart=0

Edit:

I can delete the same file – a screenshot in the desktop – using the terminal and I am not prompted for a password. If I use the GUI then I am prompted.

Also, If I create a new account and make a new screenshot and try to delete everything works just fine. No password required.

When I am prompted for my password and I write it, the file is then deleted yet it doesn't appear in the bin.

Nerian
  • 1,297

9 Answers9

28

The problem was that the .Trash folder in my user's directory was owned by root.

➜  ~  l | grep .Trash
drwx------   82 root    staff    2788 25 jul 17:26 .Trash

In order to give back the ownership to my user issue the following command:

➜  ~  sudo chown your_user_name ~/.Trash 
Nerian
  • 1,297
4

Go to /Users and choose your home folder. Hit Cmd+I for the info pane for that folder and expand Sharing and Permissions.

Next to your username you should see Read & Write. Now, this permission DOES NOT apply always to the enclosed folders. You need to click on your username and then down on the wheel and arrow button and choose from the drop-down menu "Apply to enclosed folders".

This happens because when you copy folders and files between computers they maintain their original permissions and do not automatically update to reflect their new location.

slhck
  • 228,104
andi
  • 41
  • 1
3

I had a similar problem and found the solution here: https://discussions.apple.com/thread/3195797?start=0&tstart=0 – it was an issue with ACL's, not permissions.

[...] Finder asks for a password when I try to move any file in my $HOME to the Trash. Turns out that I had some weird ACLs set [...]:

$ ls -le .DS_Store 
-rw-------+ 1 bob  staff  24580 Aug  7 01:04 .DS_Store
0: group:everyone deny delete

$ chmod -a "group:everyone deny delete" .DS_Store

After the chmod, deleting foo.txt succeeded. Running [the chmod command] with -R on $HOME will remove this ACL from all objects in $HOME.

[i.e. chmod -R -a "group:everyone deny delete" Foo/]

terrace
  • 295
2

One of the reasons that you will see a SU authentication prompt when deleting is because you may have ACLs enabled. They augment the UNIX fs permissions set available in Mac OS.

Open Terminal and navigate to the folder that you have problems with. Type:

ls -ale

Observe if you have entries like:

drwxr-xrwx+ 31 myname  staff     1054 Apr 15 14:19 Documents
 0: group:everyone deny delete

if you do, you can fix them with the folioing command:

chmod -N filename

This will remove the ACLs from that file/folder. After you copy it under your user (if you are doing user migration, like me) then it will inherit that users top-level ACLs

To recursively remove all ACLs from a folder:

chmod -R -N

Cheers!

Stephan
  • 21
  • 2
1
  1. Restart your MacBook, and before you hear the chime, hold down the Command and R keys.

  2. You’ll be at the Repair Utilities screen. Click the Utilities item in the Menu Bar, then click Terminal.

  3. In the Terminal window, type resetpassword and hit Return.

  4. The password reset utility window launches, but you’re not going to reset the password. Instead, click on icon for your Mac’s hard drive at the top. From the dropdown below it, select the user account where you’re having issues.

  5. At the bottom of the window, you’ll see an area labeled Reset Home Directory Permissions and ACLs. Click the Reset button there.

The reset process takes just a couple of minutes. When it’s done, exit the programs you’ve opened and restart your Mac.

1

Just re-apply the read write access to the enclosed folders of the home directory and the problem is solved.

soandos
  • 24,404
  • 28
  • 103
  • 134
kjco
  • 11
  • 1
0

You probably did this already, but make sure you have write privileges to the files you're deleting. Select one of them in Finder and press cmd+i and look under "Sharing and Permissions."

From the same window, check that the folder/file isn't locked.

Also, click Apply to enclosed items.. in the gear drop-down list for the selected name.

  • It says that my user has write and read permissions. Also it is not locked. Check my edit to see the detailed output. – Nerian Jul 22 '11 at 18:25
0

A workaround I found was to create another user in the system and move to it. This bug doesn't seem to affect new users on the system.

0

Download (buy or demo) MacPilot app. Use tools - General - Files and Folders - Wipe Access Control List Data - chose your home folder