Linux / UNIX Tech Support Forum
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 ...
|
|||||||
| Linux software General questions and discussion about Redhat/Fedora Core/Cent OS, Debian and Ubuntu Linux related to softwares should go here. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
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, (iptables) see following url http://www.cyberciti.biz/faqs/2006/0...nux-server.php
__________________
Vivek Gite Linux Evangelist |
![]() |
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 | 29-07-2007 05:32 AM |
| Howto change ip address in Linux | chiku | Networking, Firewalls and Security | 1 | 29-04-2007 04:51 PM |
| Static ip address in Ubuntu Linux howto | raj | Networking, Firewalls and Security | 0 | 18-01-2007 03:18 AM |
| Sendmail control incoming email to accept, deny, or relay | jerry | All about FreeBSD/OpenBSD/NetBSD | 1 | 22-06-2006 01:39 PM |
| Debian recovery mode read only access make it write access | Donavit | Linux software | 1 | 30-12-2005 12:49 AM |