Friday, February 1, 2013

How to check if a IP is blocked from Iptables............

Solution:

How to check if IP is blocked from Iptables

Check if IP is blocked:

# iptables -L -n --line | grep [IP Address]


If IP appear as DROP or REJECT, the IP has been blocked


Unblock the IP Address:

# iptables -I INPUT -s [IP Address] -j ACCEPT



Blocking back an IP Address:

# iptables -A INPUT -d [IP Address] -j DROP

How to fix the date issue in VPS.....

Issue:

root@server [~]# date -s "13 Nov 2012 16:01:00"
date: cannot set date: Operation not permitted

Fix:
To correct this problem, exit from the container (#exit) and issue the following commands.

# vzctl stop

# vzctl set –save –capability sys_time:on

# vzctl start

# vzctl enter

Not necessary

# mv /etc/localtime /etc/localtime.old

# ln -s /usr/share/zoneinfo/America/Los_Angeles /etc/localtime

Now you can set the date and time appropriately.