Google
 

Linux Distro Counter

Welcome to Open Source Software and Linux Blog.

Hi, everyone!. I just created this blog to share knowledge about open source software and Linux. If you all have knowledge and info related to open source / Linux, please share or send me an email. Thanks ^_^

Wednesday, May 23, 2007

How to implement a hosts.allow and hosts.deny (tcpwrappers)

To make your server block and allow some deamon process like sshd, ftpd and etc; use this configuration:

1. Open terminal
2. su - if you not a root user
3. Use your favorite editor like vi or nano. In this case I use vi editor.
4. Type "vi /etc/hosts.deny" without "".
5. At the buttom line just type "ALL:ALL:deny" to restricted all of deamon process
6. Save it.
7. Open "/etc/hosts.allow" with vi editor
8. At the buttom line "ALL:(some ip that you allow):allow" to allow anything from my IP address
9. Save it.

Done.

You can test to use sshd or ftpd to the server from others pc/server.

No comments: