LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   Deny root access to a given file (https://www.linuxquestions.org/questions/linux-security-4/deny-root-access-to-a-given-file-848908/)

phru 12-07-2010 01:09 PM

Deny root access to a given file
 
Hello all,

I would like to know if it is possible to deny the access to a file for root? Would ACL's be a possibility? I have "googled" around but haven't found anything interesting (except SELinux).

I should secure a password file to an important database.

Thanks in advance

Cheers
phru

stress_junkie 12-07-2010 01:32 PM

It is not possible using normal file permissions.

The only thing that I can think of would be to encrypt the file and not tell "root" the password. However root could still delete the file.

Dani1973 12-08-2010 06:27 AM

root can always take ownership and change permissions so it wouldn't work.
It's the same on Windows for administrators and I guess it's like that on any OS and always will be.

anomie 12-08-2010 08:57 AM

Right - encryption sort of solves this problem.

I say "sort of" because root could always infect your shell or your encryption binaries / scripts / kernel modules / etc. If he's able to capture your key that way, it's game over.

chickenjoy 12-08-2010 09:26 AM

Might want to look into the "chattr" program in this guide. It wont prevent root from reading files; but it just might make it harder for them to modify or delete them.

Dani1973 12-08-2010 09:35 AM

Quote:

Originally Posted by anomie (Post 4184714)
Right - encryption sort of solves this problem.

I say "sort of" because root could always infect your shell or your encryption binaries / scripts / kernel modules / etc. If he's able to capture your key that way, it's game over.

Don't know how it exactly works in Linux under Windows for example, if you use encryption for a user account the administrator cannot access that account anymore because the account is encrypted with the users password and if the administrator would reset the users password it would make the user user unreadable and broken.
Personaly I never had to use account encryption.

If a root user was to 'infect' your shell or encryption binaries then you have a more serious security problem ... why did a user with such sick ideas get root access!

phru 12-08-2010 11:06 AM

Thank you all for your replies!


All times are GMT -5. The time now is 12:04 AM.