Can I create a different permission to access the hosts files so that the sudoer needs this extra key in order to access it? Also, would password protecting the file prevent OS from accessing it freely in any other way?
|
|
So you can, for example, give some users permission to execute commands that read certain files that they otherwise wouldn't be able to read, and then give some more trusted users permission to execute, say, Note that you have to be very careful about the commands you enable in Anyone who has full root access, either by knowing the root password (if there is one) or via Note that the word "access" refers to both reading and writing. Everyone on the system should be able to read |
||||
|
|
|
For the /etc/hosts file to work, applications should be able to read it freely; otherwise it won't work. Therefore if you password protect it (e.g. encrypt it with a password) from being readable, it would become useless unless somehow you can incorporate the password in the call. As for writing to the file; a sudoer may do whatever he/she needs, including overwrite it, so that won't work either. |
||||
|
|
|
The hosts file have the same permissions options as any other file. By default only the root user is allowed to make changes. If people that you do not trust know the root password, change it and create another user with the permissions they need, and they will no longer be able to modify files you want to protect. |
|||
|