Nov 07, 2017 chmod & Why It Matters: User Permissions in OS X November 7, 2017 / Shannon / 0 Comments So you’ve maybe been in this situation before – you’re at a post facility, and you’re trying to move a file from one location to another on a server, and you’re prompted for a password. Rwxr-xr-x 1 you staff 277 Dec 17 15:21 todo.sh The x's above indicate if the file has executable permissions. I'm thinking that chmod did add executable permissions, so most like you do not have the directory containing todo.sh in your PATH environment variable.
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.comMar 1 '12 at 3:45
This question came from our site for system and network administrators.
5 Answers
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:
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:
Thanks to @Jeff for the correction. I was miss-remebering.
Sudo Chmod Mac Os X
- 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.
Chmod 755 Mac Os X
With the apple quarantine attribute, chmod is not enough to remove it.
You need to remove the attribute explicitly:
grg♦Check attributes:
Reset ALL attributes recursively:
Checked on macOS High Sierra (10.13).
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