The presence of the /etc/nologin file prevents non-root users from logging into the system via SSH or any other login method. Only the root user can log in when this file exists. This file is commonly used to temporarily disable user logins during system maintenance.