Articles


How to allow ssh to root user only from the local network?

How to allow ssh to root user only from the local network?



Posted bynitheesh,30th Jul 2016

This article will help you if you have local server running and somebody needs to root ssh login only from your local network. 

Open a terminal.
Edit the ssh config file located /etc/ssh/sshd_config

  $ sudo vim /etc/ssh/sshd_config

  Search for '# Authentication:' line and add the below lines inside that section.

  # the following overrides the general config when conditions are met. 

  Match Address  192.168.0.*

      PermitRootLogin yes

This will only allows root login from ips that are inside 192.168.0.* subnet.

Restart the ssh server

 sudo service ssh restart