X
    Categories: Linux

Simple trick to secure server for added security

You always need to think in terms of how can we secure server so that it will not be targeted by the hacker. Here is the simple trick is to restrict users in ssh configuration to secure the server.

By default ssh configuration accepts all the users to the server, that’s the biggest loop hole in secure server environment. We can change or restrict this to only to certain users in the configuration so that our server becomes secure server.

So here is a trick to secure server,

  1. Open the ssh configuration file.
           [root@kalwa1 ~]# vi /etc/ssh/sshd_config
  1. Now add following lines in the file
AllowUsers root

This line states that only root user can able to login to secure server rest of the users will be denied.

3. Now restart sshd daemon

[root@kalwa1 ~]# service sshd restart
Stopping sshd: [ OK ]
Starting sshd: [ OK ] 

4. Now if you tried to login to secure server other than root system responds with “Access denied” message:

View Comments (3)

  • Never ever allow root login ... that's the reason why you should set

    PermitRootLogin No

    Create a unpriviliged user and set

    AllowUser to this unpriviliged account!

    Cheers,
    Lars

  • don't allow root login, enable public key auth, disable password login, as long as you keep the private key private, you're most likely secure

Related Post