[HOW TO] Restrict SSH connection

In afternoon I thought about restriction ssh Linux server. I know exactly the incoming ssh, therefore I have to restrict to improve secure system.

Secure system is not easy, it's hard to say that you completely control everything on system. With me, it combines of system, network, people, process.

And day-by-day you also learn/ practice and practice, join the community to discuss and update news. 

Back to this article, I will instruct you how to restrict ssh login access on Linux.

I use Cent OS 7.2, OpenSSH_6.6.1p1.

Firstly you have to edit /etc/ssh/sshd_config. Go to the end of sshd_config, and add:



AllowUsers user@IP
In case you allow 'user' from exactly IP

AllowUsers user
In case you allow 'user' from every IP

AllowUser user@192.168.1.*
In case you allow 'user' from subnet



After that, you have to restart sshd service to apply the new change.

Thank you for reading this article, please a comment if you are interested.

Tiến Phan - R0039

Knowledge is Endless

Sharing for Success

0 nhận xét:

Post a Comment