1

When I'm using ls -Z /etc I only get question marks and filenames. I don't get anything about the security context. Does anyone know anything about this?

ls -z output

1
  • 3
    Are you sure the files have a security context set at all? Commented Dec 15, 2022 at 5:24

1 Answer 1

1

You are probably running a regular installation of Ubuntu (judging from the colors of your terminal). SELinux, which gives a security context (amongst others) is not enabled in Ubuntu by default, and I actually doubt pretty much that you want to enable it at all.

Ubuntu by default uses AppArmor, which is an alternative to SELinux. However, AppArmor works differently and does not collaborate with ls -Z. SELinux support in Ubuntu is considered experimental, and if you really want to run SELinux, you will be better off with a RedHat based distro.

If you are unsure whether your system actually has SELinux enabled, try typing sudo sestatus. Most likely, you will get sudo: sestatus: command not found. What you should see in Ubuntu is the output of sudo aa-status (a similar command from AppArmor).

Here is a nice comparison between AppArmor and SELinux.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .