Disable or Enable SSH Root Login and Limit SSH Access in Linux

Download Your Free eBooks NOW - 10 Free Linux eBooks for Administrators

Ravi Saive

Simple Word a Computer Geek and Linux Guru who loves to share tricks and tips on Internet. Most Of My Servers runs on Open Source Platform called Linux.

Host Your Own Website at $97 Discount + One Free Domain Using our Promo Code 'Tec97' (Enter this code during Signup) - Signup with DreamHost Now!

Download Free Linux eBooks

Advanced Bash-Scripting Guide
Linux Bible
A Newbie's Getting Started Guide to Linux
Ubuntu Linux Toolbox: 1000+ Commands

You may also like...

11 Responses

  1. Ermir says:

    Hi Ravi,
    I have limitet access for a user to access only his home folder on SFTP(tutorial –> https://www.linode.com/docs/tools-reference/tools/limiting-access-with-sftp-jails-on-debian-and-ubuntu).But now i can’t login via putty with this user.What’s going wrong?
    I put “AllowUsers username” at the botom of sshd_config but still nothing.Please help?

  2. Rajgopal H.G. says:

    Excellent article. Even the first time Linux users can understand and implement it at one shot.!!

  3. Ilya says:

    There are steps in the article like this:

    Restart the sshd service.
    # /etc/init.d/sshd restart

    Restarting can kill existing SSH connections to the host.

    Instead of restarting when only reconfiguration is needed you can send SSHD process the SIGHUP signal with KILL command:

    sudo kill -s SIGHUP $SSHDPID

    You will need $SSHDPID, process ID for SSHD , it can be found by a command like

    ps -AF | grep /usr/sbin/sshd

  4. Garik says:

    Hello!
    Thank you for yours very usefull articles. You are a master!

  5. k satyanarayana says:

    Need document of ” how to existing windows 2003 domain convert into Linux domain without distrubence of existing.

  6. Matt says:

    Hi Ravi,

    I have disabled the root SSH on CentOS with Cpanel.
    I need to reenable it but my other user now can’t access the # vi /etc/ssh/sshd_config

    User apparently does not have the sudo rights I guess..
    What can I do?

    Thank you

    • Ravi Saive says:

      Why you allowing your normal user to access sshd_config file?

    • Vien Mai says:

      You can open ssh session to the server with normal user then issue sudo su (On Ubuntu) to change to root then you can re-enable ssh for root. However, I have heard that login by root account over SSH is not encouraged due to security reason.

  7. rahul says:

    hello. thank you for this.
    i like your article.
    you are very perfect in it.
    good luck

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Join Over 62000+ Linux Users
  1. 48100
  2. 2222
  3. 11697
Enter your email to get latest Linux Howto's