2

I'm curious as to what happens to a file if let's say, it's permissions only allow the owner to read and write, and the group and everyone have no access at all. (700, or rwx------).

Let's say the file is on an external drive, so it's possible that the owner is no longer available because we have disconnected the drive and connected it to another computer. How am I able to access the files in this case? Can I still access them by logging in as a superuser?

On one hand, it'd be nice to be able to login to a superuser on any computer to access the file, because at least there's a backup plan if the original computer ever dies, etc. On the other hand, it seems like a security concern that anyone can technically access data on an external drive, or even an internal drive perhaps, by declaring themselves as a superuser.

Gary
  • 1,300

1 Answers1

5

The superuser will always be able to read any file. And will be able to change owner or permissions of any file, regardless of the original owner.

So yes, you could access those files using the superuser, and you could change permissions or owner to be able to acces them with your own regular user.

This is indeed very useful, for example, to make backups, root can make a backup of the whole drive regardless of any permission, and you will be thankful for that later if you happen to lose anything.

Regarding your security concern, anyone who has physical access to any drive, will be able one way or the other to access the data in it. If you really are worried about this, you coul encrypt the data, so even if the superuser can access it, there won't be anything useful if he doesn't know the key.