dropbear icon indicating copy to clipboard operation
dropbear copied to clipboard

Feature request: Add support for /etc/nologin

Open AlbertVeli opened this issue 1 year ago • 0 comments

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:

  1. 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.".
  2. 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!

AlbertVeli avatar Apr 04 '24 16:04 AlbertVeli