45

I have a file with the following permissions on my MacBook Pro:

-rwxr-xr-x@ 1 root wheel 101K Feb 29 17:09 apachectl

What does the @ stand for? I can't execute the file and this is the only thing that's standing out to me. How can I get rid of it?

Just as some background, I copied this from a Time Machine backup.

migrated from serverfault.com Mar 1 '12 at 3:45

This question came from our site for system and network administrators.

33

If the file or directory has extended attributes, you'll see an @ in the permissions field. For extended security information (ACLs), you'll see a +.

From man ls on OS X:

-@      Display extended attribute keys and sizes in long (-l) output.

The xattr program can be used to display and manipulate extended attributes. Take a look at what's there before deciding to go while deleting those attributes, though. Definitely take a quick look at the man page for xattr too.

A quick example from some example PHP compromise code I keep around for reference:

$ ls -@l php-compromise.php 
-rw-r--r--@ 1 user  group  502620 Jul  5  2011 php-compromise.php
    com.apple.FinderInfo        32 
    com.apple.TextEncoding      15 
22

Thanks to @Jeff for the correction. I was miss-remebering.

  • The @ is displayed with a extended attribute is set
  • The + is displayed for an ACL.
  • IF you have both an attribute and a ACL then you see @.

Run the command ls -le filename to see if it has any ACLs set.

Since your problem seems to be with accessing the file, I bet you have a ACL set in addition to an extended attribute.

To get rid of an ACL run echo | sudo chmod -E filename for a file or echo | sudo chmod -R -E directory name for a directory.

See the chmod man page.

  • thanks for the response. how can I get rid of it? – VinnyD Mar 1 '12 at 1:17
  • Updated with an answer that I believe should work. – Zoredache Mar 1 '12 at 1:20
  • @Zoredache ACL permissions come with a plus sign. The @ is "extended attributes." – Jeff Ferland Mar 1 '12 at 1:22
  • Yeah, I am seeing that as I double check. I must have remember backwards. And what happens when a file has both? – Zoredache Mar 1 '12 at 1:24
  • Nevermind, I got a mac booted up. If you have an @ extended attribute and + acl set, it appears that ls will show a @. Since he is having problems accessing a file, it seems likely to me that the problem more likely that he has a problem with an ACL. – Zoredache Mar 1 '12 at 1:33
5

With the apple quarantine attribute, chmod is not enough to remove it.

You need to remove the attribute explicitly:

sudo xattr -d com.apple.quarantine my_file
1

Check attributes:

ls -le

Reset ALL attributes recursively:

sudo xattr -rc <Directory>
sudo chmod -R -N <Directory>

Checked on macOS High Sierra (10.13).

0

I found that the -E or -N are actually invisible even when using sudo. The only way I could fix it was by logging in as root

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .