Ability to control and manage visitor access to your website is a significant aspect of access control. After you login as a root via SSH, you need to execute the command mentioned below.
Iptables-I INPUT –s IP_ADDRESS_j DROP
You will have to replace ‘IP ADDRESS’ with the IP address that you wish to block.
You can search for visitor’s
IP address by making use of web statistics tools to get more information about your website’s visitors. Click on the icon ‘latest visitors’ in your
cPanel and look for host information.
If you need block spammers, malicious visitors, or robots from accessing your site, then you can also block IP address by using IP Deny Manager in your cPanel. For this you need to add ‘allow’ or ‘deny’ code in your .htaccess file.
Look for the key ‘Add an IP to Deny’ and enter a domain name or IP address to be blocked and subsequently click the Add button. Alternatively, you can also unblock the IP address by using IP Deny Manager. Look for ‘Current IP Addresses being blocked’ at the bottom and click remove. If you set the option of ‘deny from all’, then it will block everyone.