Unix permissions

10,064

Solution 1

'ls -l' will tell you all you need to know.

Permissions Directories Group   Size    Date            Directory or file 
drwx------  2           users   4096    Nov 2 19:51     mail/

If you have root permission, try a 'sudo chmod 777 hosts'.

Solution 2

You are probably not the owner of the file.

Solution 3

the owner of the file will need to change permissions or change ownership by using chown,

here are some examples: http://en.wikipedia.org/wiki/Chown

Solution 4

If you have a super user's password you could always :

$ sudo chmod 777 hosts

which, of course, is never a very good idea.

Share:
10,064
Awesomeness
Author by

Awesomeness

I am a juke box hero :) http://www.youtube.com/watch?v=dlAe77E3gxY :) And big....huggeee thanks to everyone who has helped me on StackOverflow. You guys are great!

Updated on September 10, 2022

Comments

  • Awesomeness
    Awesomeness over 1 year

    I have a file of which I need to change contents, that has these permissions:

    -rw-r--r-- 
    

    How do I find out which permissions group I belong to, so I can do a chmod command?

    I just tried to do chmod and I got an error:

    $ chmod 777 hosts
    chmod: Unable to change file mode on hosts: Operation not permitted
    

    Here is my ls -l

    -rw-r--r--  1 root  wheel  313 Apr 16 13:04 hosts