Is it possible to disable file permissions on a ext3 or ext4 file-system

ext3ext4filesystemspermissions

Is it possible to disable file permissions on an ext3/4 file-system?

Just wondering if it's possible to completely disable or ignore file permissions on a ext3 or ext4 file system. Perhaps a mounting option?

I'm not concerned about the security implications as I would be doing this for testing and with removable media.

Best Answer

That's not the only thing you can do.

There is a way to just grant everyone permissions without using the regular permissions, that will clutter your display (in a way).

What this means is that ls --color (by default) will always display o:rwX in a block background, which is hideous and only meant to alert users to wrong permissions (when they are right for you).

But you can easily achieve universal (or near-universal) write permissions to your files by using access control lists.

setfacl -d -m g:sudo:rwX .
setfacl -m g:sudo:rwX .

will give rwX permissions to all people in the sudo group. Since most of your systems, you will have a user in the sudo group, particularly for removable media (and hence, local systems) you will always have access anywhere for anyone in that group (which is you). You can also extend it to users, in case you are on some other system which uses that group:

setfacl -d -m g:users:rwX .
setfacl -m g:users:rwX .

The -d flag means that the permissions will propagate to all newly created files (default). The only downside is that you cannot actually normally see those permissions, which means you'd rather turn them off completely (hence, what is the use on a removal medium if you set permissions that everyone can circumvent anyway, right?). That's like saying: You can access these files if you call yourself John. Okay, I call myself John. Fine, you have access now.

(Everyone can assume root on every system they own and hence filesystem permissions mean nothing).

ExtFS is just not meant for removable media. There are no Linux filesystems that are really useful on removable media, but FAT and NTFS have the downside of not really supporting symlinks and execute flags, which is difficult for git repositories, for example. Just my opinion here.

You can only see your file ACL by doing:

getfacl <file>

And when you ls -l you will see:

drwxr-xr-x+ 4 user user 4096 aug 31 03:40 .

The + indicates that there is an ACL active on the file (or directory).

The output of getfacl will be (for example):

# file: .
# owner: user
# group: user
user::rwx
group::rwx                      #effective:r-x
group:sudo:rwx                  #effective:r-x
mask::r-x
other::r-x
default:user::rwx
default:group::r-x
default:group:sudo:rwx
default:mask::rwx
default:other::r-x

I don't know all the details, but this should work. As long as you are in sudo, you can do anything.

Related Question