dropbear
dropbear copied to clipboard
Feature request: Add support for /etc/nologin
Description
On Linux systems, it is common to create a file named /etc/nologin to deny login access (except for root). This feature can be useful for various scenarios, such as performing maintenance tasks or temporarily taking the system offline.
Proposed Implementation
To support this feature, consider making the following changes in the codebase:
-
src/svr-main.c (main_inetd()):
- Check for the existence of
/etc/nologin. - If the file exists, prevent new login sessions except for the root user.
- Display an appropriate message to users attempting to log in during this restricted period. For instance
"User login not allowed at this time.".
- Check for the existence of
-
src/svr-main.c (main_noinetd()):
- Similar to the above.
Benefits
- Enhanced security: Prevent unauthorized logins during critical system operations.
- Improved system management: Facilitate maintenance tasks without disrupting active user sessions.
Thank you for considering this enhancement!