How do you set a system-wide umask for all users?

Prepare for the Red Hat Certified Systems Admin Exam EX200. Enhance your skills with interactive quizzes, flashcards, and detailed explanations. Ace your certification exam today!

Multiple Choice

How do you set a system-wide umask for all users?

Explanation:
A system-wide umask is the global default that determines what permissions new files and directories will have for all users. The place to establish that default across the whole system is the UMASK setting in /etc/login.defs. When you set UMASK 022 there, new files will typically be created with 644 permissions and new directories with 755 permissions, meaning read access for group and others but no write permission. This approach provides a consistent baseline for all accounts and across login sessions, without needing to edit individual user or shell startup files. Other files control umask only in specific contexts. /etc/profile affects login shells, and /etc/bashrc or a user’s personal .bashrc affect interactive shells, so they can override or differ from the global default. That’s why /etc/login.defs is the best single, system-wide location for the default when accounts are created and when the login process establishes a session.

A system-wide umask is the global default that determines what permissions new files and directories will have for all users. The place to establish that default across the whole system is the UMASK setting in /etc/login.defs. When you set UMASK 022 there, new files will typically be created with 644 permissions and new directories with 755 permissions, meaning read access for group and others but no write permission. This approach provides a consistent baseline for all accounts and across login sessions, without needing to edit individual user or shell startup files.

Other files control umask only in specific contexts. /etc/profile affects login shells, and /etc/bashrc or a user’s personal .bashrc affect interactive shells, so they can override or differ from the global default. That’s why /etc/login.defs is the best single, system-wide location for the default when accounts are created and when the login process establishes a session.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy