How to set a specific SELinux context for the content of a directory different than the the context of the directory itself?

Solution In Progress - Updated -

Issue

-We need all ".ssh" directories located in the /home of all users to have "ssh_home_t" context.
-All of the files inside of those ".ssh" directories should not have "ssh_home_t", except the files named "authorized_keys".
-All files (including new ones) inside ".ssh" should have "default_t" instead.

Environment

Red Hat Enterprise Linux
SELinux

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content