System Administration Guide: Security Services

How to Restrict Superuser (root) Login to the Console

  1. Become superuser or assume an equivalent role.

  2. Edit the /etc/default/login file.

  3. Uncomment the following line:


    CONSOLE=/dev/console

    Any users who try to remotely log in to this system must first log in with their user login, and then use the su command to become superuser.

  4. Attempt to log in remotely as superuser to this system, and verify that the operation fails.