[PLUG] Chmod question, before I mess things up

Rich Shepard rshepard at appl-ecosys.com
Thu Dec 17 02:33:05 UTC 2009


On Wed, 16 Dec 2009, John Jason Jordan wrote:

> -rw-r--r--.  1 jjj jjj  11968 test_pdf_form.pdf
> -rw-------.  1 jjj jjj  1552141 thinkpad_ultrabay.pdf
> -rwx------.  1 jjj jjj  2240700 ubuntupocketguide-v1-1.pdf
> -rw-------.  1 jjj jjj  4822994 ultrabay_adapter_40y8746.pdf
> -rw-rw-r--.  1 jjj jjj 20839 Baker03.odt
> -rw-r--r--.  1 jjj jjj  70 VLC_radio_playlist

John,

   None of the above should be executable. All you'll do with the .pdf files
is read them; they can be 444 without harm since no one can directly write
to them. The .odt file is an OpenOffice.org text file; also with the proper
permissions.

> drwx------.  4 jjj jjj  Website

> I note that all my directories are executable. Perhaps there is a
> reason for that. But there is a PDF that is executable. Why?

   'Cause you cannot cd to that directory unless it's both writable and
executable. I always forget the exact relationship, but either w or x lets
you cd into the directory, the other allows you to list the files in there.

> There is an OOo Writer file that is -rw-rw-r--, where most plain data
> files are rw-r--r--. Why?

   No particular reason. In the second case only the owner can write to the
file, but anyone can read it. It all depends on who you want to read and/or
write to that file.

> Every folder on my computer has a similar m?lange of permissions for
> data files.

   Make all directories and executable files 755; other files 664.

> Also, just now I created a test file with Gedit. It appears as:

> -rw-rw-r-- 1 jjj jjj 5 Test.txt

> So apparently jjj's umask in Fedora 11 is to create files that are
> -rw-rw-r--. And apparently jjj's umask when he (I) used to use Ubuntu
> was -rw-r--r--. I can change the permissions on the older files to
> -rw-rw-r--, but what happens if the (now) me downloads a file instead
> of creating it de novo? Will it be -rw-rw-r--? What happens when I do a
> dist-upgrade to Fedora 12 - will it change my umask? I want
> things consistent and predictable. Once I clean up the mess I don't
> want to proceed to create a new mess.

   1.) Ignore all this unless you have nothing better to obsess over. You're
getting so wrapped up in insignificant details (at your level of use) that
you're missing the big picture.

   2.) Look at 'man umask' to see default perms on new files.

   3.) The permissions won't change or affect anything if you change
distributions.


Rich



More information about the PLUG mailing list