What is an executable directory?
o+wis set the directory changes colors to a background green, what does this mean? Why doesn't it do it for
ug+w, but only for
Additional question after reading the comments: Is making a directory executable a security risk? If so, why?
The coloring is controlled by the
DIR_COLORS* files that reside under `/etc. For example on Fedora 19 I have the following 3 files:
$ ls -l /etc/DIR_COLORS* -rw-r--r--. 1 root root 5004 Jan 20 2014 /etc/DIR_COLORS -rw-r--r--. 1 root root 5682 Jan 20 2014 /etc/DIR_COLORS.256color -rw-r--r--. 1 root root 4646 Jan 20 2014 /etc/DIR_COLORS.lightbgcolor
The coloring is completely cosmetic and keys off of the output that
ls is generating. You can disable it like so:
$ ls --color=never <other options>
DIR_COLORS* files can be viewed, they're just text, and have decent commenting, explaining their functionality. This line is why it's displaying as green:
OTHER_WRITABLE 34;42 # dir that is other-writable (o+w) and not sticky
Directories need to be executable so that user's can
cd into them and run commands. Without that bit, the directories cannot be accessed.
$ mkdir adir $ chmod 644 adir $ cd adir bash: cd: adir: Permission denied
The reasons behind this are already extensively discussed in this other U&L Q&A titled: Execute vs Read bit. How do directory permissions in Linux work?.