I am completely new to Unix. I want to access my friends file whose ls -l gives:

-r--r----- 1 root filename

Note that I am not the root user and just a normal user. My question is how to read this file? I tried to change the ownership by using chown and change the permission using chmod but it gives Operation not permitted.

Outputs of variuos commands :

$ ls -l 
total 4
-r--r----- 1 root abacus 373 Nov 12 19:19 abacus
$ groups
$ cat abacus
abacus: Permission Denied 
  • 1
    You can't. You don't own the file and the permissions don't give access to anything other than the user and group who own it. – Joe Nov 17 '12 at 18:49
  • Is there some command by which I can know the group which I belong to ? – Wayne Rooney Nov 17 '12 at 18:52
  • If your friend really agrees with you then he will apply other permissions to the file. Currently permission for you has been explicitly denied. There might be a reason for this. Ask him, if you agree that you should be able to read that file he might change the permissions. – arkascha Nov 17 '12 at 18:53
  • 1
    @you can find out your groups woth the command groups. – arkascha Nov 17 '12 at 18:53
  • @arkascha :Using the groups command lists me in the group ..So I should be able to read the file, but I cant – Wayne Rooney Nov 17 '12 at 18:55

Based on the information given, it looks like you won't be able to read the file. The owner is root, and the group abacus; the file is set to be readable only by the owner and group. And it looks like you are not in the group; you are only in the group Wayne.

Unless your friend was asking you to try hacking his system (for instance, if he had left the /etc/group file world writeable, so you could add yourself to the abacus group), then you should not be able to read that file.


You cannot change the ownership of the file because you are not the superuser (root), and you do not already own the file. If you could change the ownership/permissions on files you do not own, it would completely nullify the whole purpose of the permissions/ownership mechanism, which is computer security.

If you were operating a multiuser system, would you want your users to be able to muck about with files they do not own? Would you like other users to modify your files without your permission?

  • Actually , we have had a bet on this.. He tells me that I can read the file , but I tried my best only to fail.. I am not trying to hack his system in anyway.. – Wayne Rooney Nov 17 '12 at 18:58
  • That means you must be a member of the group called abacus; Seeing from the directory listing r--r--- I can see that the owner, and group members have read permissions -- no other permissions have been granted for this file. The `groups' command will tell you all the groups to which you are currently a member... – vyudh Nov 17 '12 at 21:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy