From the course: Linux: Storage Systems

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

Restore default SELinux file contexts

Restore default SELinux file contexts - Linux Tutorial

From the course: Linux: Storage Systems

Restore default SELinux file contexts

- [Instructor] Now let's talk a little bit about security-related things for file systems and files. And one of those is SELinux. And SELinux is on some Linux distros, an alternative similar as AppArmor, which is on different distros. SELinux uses what it calls file context, and you can list the context with the minus z or zed option. So what happens is, first of all, the ordinary permissions are checked, and then after that, the additional SELinux context are checked to see if something is permitted. For example, your web server is typically only allowed to serve files that have certain contexts. So that if say there's a bug in it, then it won't serve up other system files. So there's commands having to do with this context. You can change the context on a file. Here, we're changing, setting this context on this file here. Restorecon will set back the defaults. And in the directory etc/selinux/targeted/contexts/files, there are a bunch of these context files to specify what the…

Contents