Account Links: Cart | Your Account | Logout

Skip to content

Red Hat Knowledgebase

Red Hat Knowledgebase Search:

Updated Within the Last:

New Solutions within the last day New Solutions within the last week New Solutions within the last month

Browse by topics:


Click to View a Topic
Red Hat Enterprise Linux > Security > Issue <<  86 of 218 >>

Solution Tools:


Email a Solution Postcard Printer version Submit a comment on this answer Update notifications Request an answer Back

Article Reference

Article ID: 4114
Last update: 07-07-05
Issue:
How do I secure SSH to disable direct root login?
Resolution:

This article recommends that you also restrict access to your system by limiting users root access with the su command. Please see additional articles in our knowledgebase on how to restrict the use of su command.

This disallows direct root login, so when you connect using SSH you need to first login as a normal user, then su to obtain root access.

  • Edit the /etc/ssh/sshd_config file with a text editor and find the following line:
    #PermitRootLogin yes

    Change the yes to no and remove the '#' at the beginning of the line so that it reads:

    PermitRootLogin no
  • Restart the sshd service:
    # service sshd restart

    For example:

    # service sshd restart
    Stopping sshd:                                             [  OK  ]
    Starting sshd:                                             [  OK  ]
    

Additional workstation security information can be found in the Red Hat Enterprise Linux 3: Security Guide - Chapter 4. Workstation Security at: http://www.redhat.com/docs/manuals/enterprise/RHEL-3-Manual/security-guide/s1-wstation-privileges.html


How well did this entry answer your question?


good wrong incomplete out of date
Red Hat Enterprise Linux > Security > Issue <<   86  of  218  >>