Redirect Error Page to Main page. Add the below coding in html file and redirect the error page to here using .htaccess. <HTML> <HEAD> <TITLE>oops ... get lost?</title> <meta name="MSSmartTagsPreventParsing" content="TRUE"> <META NAME="generator" CONTENT="NoteTab Pro"> <META HTTP-EQUIV=REFRESH CONTENT="5;URL=http://www.domain.com"> </HEAD> <BODY> <center> <font face="verdana, arial"> <h2>oops ... I think you got lost</h2> <h3>We'll return to you our Home Page<br> and you can try again from there</h3> </font> </center> </BODY> </HTML> Add the below in .htaccess: ErrorDocument 404 http://www.domain.com/oops.html
Redirect Error Page to Main page.
December 19, 2008Using TCP wrappers to allow only specific hosts to connect
December 15, 2008Using TCP wrappers to allow only specific hosts to connect
This approach is useful if you would like to allow only specific hosts on a network to be able to connect to your SSH service, but you don’t want to use or mess up your iptables configuration. Instead, you can use TCP wrappers; in this case the sshd TCP wrapper. I will make a rule to allow only hosts on my local subnet 192.168.1.0/24 and remote host 193.180.177.13 to connect to my SSH service.
By default TCP wrappers first look in the /etc/hosts.deny file to see what hosts are denied for what service. Next, TCP wrapper looks in /etc/hosts.allow file to see if there are any rules that would allow hosts to connect to a specific service. I’ll create a rule like this in /etc/hosts.deny:
sshd: ALL
This means that by default all hosts are forbidden to access the SSH service. This needs to be here, otherwise all hosts would have access to the SSH service, since TCP wrappers first looks into hosts.deny file and if there is no rule regarding blocking SSH service, any host can connect.
Next, create a rule in /etc/hosts.allow to allow only specific hosts (as defined earlier) to use the SSH service:
sshd: 192.168.1 193.180.177.13
Now only hosts from the 192.168.1.0/24 network and the 193.180.177.13 host can access the SSH service. All other hosts are disconnected before they even get to the login prompt, and receive an error like this:
ssh_exchange_identification: Connection closed by remote host
Block Invalid access through SSH
December 15, 2008You can also use different iptables parameters to limit connections to the SSH service for specific time periods. You can use the /second, /minute, /hour, or /day switch in any of the following examples.
In the first example, if a user enters the wrong password, access to the SSH service is blocked for one minute, and the user gets only one login try per minute from that moment on:
~# iptables -A INPUT -p tcp -m state --syn --state NEW --dport 22 -m limit --limit 1/minute --limit-burst 1 -j ACCEPT
~# iptables -A INPUT -p tcp -m state --syn --state NEW --dport 22 -j DROP
Posted by We3cares
Posted by We3cares
Posted by We3cares