This is a discussion on Linux howto allow or deny access by IP address within the Linux software forums, part of the Linux Getting Started category; Iptables is full of shit. If one rule goes wrong, my ssh server and remote connectivity goes down. I am ...
|
|||||||
| Register | FAQ | Members List | Calendar | Forgotten your password? | Mark Forums Read |
|
|||
|
Iptables is full of shit. If one rule goes wrong, my ssh server and remote connectivity goes down. I am just wondering if there is a way (easy way) to allow or deny access by IP Address to services such as Apache or SSH Server, mail server etc…
Currently I want to block access to certain machines… |
| Sponsored Links | ||
|
|
|
||||
|
You can use any one of the following way to Allow or Deny access by IP address
a) Using IPTABLES based firewall b) Using TCPD - /etc/hosts.allow and /etc/hosts.deny files Option b (hosts.allow/hosts.deny) is the easiest to use and supported by all major servers. Allow incoming packets to tcpd are first matched again hosts.allow and then if there are no matches, they are checked against the rules in hosts.deny file. Syntax is as follows: server-name: hostname or ip-address Where servername can be smbd (samba), sshd (OpenSSH server), sendmail etc. For example allow sshd access to 192.168.1.1 and 192.168.1.100 IP address only. You need to put following in /etc/hosts.allow file: Code:
sshd: 192.168.1.1,192.168.1.100 Code:
sshd: .cyberciti.biz Code:
sshd: 192.168.1.0/255.255.255.0 Code:
telnetd: ALL Code:
telnetd: ALL EXCEPT 192.168.1.100 For option b, (iptable see following url http://www.cyberciti.biz/faqs/2006/0...nux-server.php |
![]() |
| Bookmarks |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| MySQL remote server access howto | raj | Databases servers | 0 | 07-29-2007 06:32 AM |
| Howto change ip address in Linux | chiku | Networking, Firewalls and Security | 1 | 04-29-2007 05:51 PM |
| Static ip address in Ubuntu Linux howto | raj | Networking, Firewalls and Security | 0 | 01-18-2007 04:18 AM |
| Sendmail control incoming email to accept, deny, or relay | jerry | All about FreeBSD/OpenBSD/NetBSD | 1 | 06-22-2006 02:39 PM |
| Debian recovery mode read only access make it write access | Donavit | Linux software | 1 | 12-30-2005 01:49 AM |