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,
- Open the ssh configuration file.
[root@kalwa1 ~]# vi /etc/ssh/sshd_config
- 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.
Lars says
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
Mark Partlett says
…and make sure you comment out his line “PermitRootLogin no” or set to “PermitRootLogin yes” 🙂
sick says
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