need to disable root login (ssh and telnet) to unix servers

Posted on 2011-04-22
Last Modified: 2012-05-11
I have setup sudo for all users. How do I now disable root ssh and telnet logins?

Question by:sonriks
    LVL 1

    Expert Comment

    open your ssh config file with your favorite editor

    PermitRootLogin no

    restart the ssh daemon

    drink soda
    LVL 38

    Expert Comment

    If you use Solaris, then eidt /etc/default/login
     and uncomment out the following line as follows:
    # If CONSOLE is set, root can only login on that device.
    # Comment this line out to allow remote login by root.

    LVL 1

    Author Comment

    Thanks,What about HP and Linux? It's a mixed environment.
    LVL 38

    Accepted Solution

    Linux, by default, you can not telnet as root.
    (make sure your/etc/securetty doesn't not content pts)

    For HP-UX, simply create a file called /etc/securetty (perm=440) and put the line
    in it. That would ONLY allow root login from the console.

    For ssh, you can do hangeles1's method for all Unix/Linux platform.
    LVL 1

    Author Closing Comment

    thanks for all the options! I'll give it a try.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Suggested Solutions

    FreeBSD on EC2 FreeBSD ( is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
    Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

    794 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now