Category Archives: News

How to Install Iptables on CentOS 7

Prerequisites

Before starting with the tutorial, make sure you are logged in as a user with sudo privileges.

Disable FirewallD

To disable firewalld on your system follow these steps:

  1. Type the following command to stop the FirewallD service:sudo systemctl stop firewalld
  2. Disable the FirewallD service to start automatically on system boot:sudo systemctl disable firewalld
  3. Mask the FirewallD service to prevent it from being started by another services:sudo systemctl mask --now firewalld

Install and Enable Iptables

Perform the following steps to install Iptables on a CentOS 7 system:

  1. Run the following command to install the iptables-service package from the CentOS repositories:sudo yum install iptables-services
  2. Once the package is installed start the Iptables service:sudo...

Scanning for malware with Linux Malware Detect (LMD)

Linux Malware Detect (LMD), also known as Maldet, is a malware scanner for Linux released under the GNU GPLv2 license. It is particularly effective for the detection of php backdoors, darkmailers and many other malicious files that can be uploaded on a compromised website. It will help you do detect infected websites and clean the infection, however securing the compromised user or website is still necessary to avoid re-infection. If the server has cPanel , we recommend you install ClamAV first, as maldet will use the ClamAV scan engine. ClamAV installation instructions are available here. You will need to be logged in as root to the server over SSH. 1 - Install maldet
cd /usr/local/src/ && wget http://www.rfxn.com/downloads/maldetect-current.tar.gz && tar -xzvf maldetect-current.tar.gz && cd maldetect-* && sh install.sh
This will automatically install a cronjob inside /etc/cron.daily/maldet so a daily...

Change the current timezone in CentOS

Type the following commands as root: cp /etc/localtime /root/old.timezone rm /etc/localtime ln -s /usr/share/zoneinfo/America/Chicago /etc/localtime Verify new settings by typing the following two commands: date ls -l /etc/localtime Thats it :)...

Find and replace text within a file using commands on Linux

How can I find and replace specific words in a text file using command line? cd /path/to/your/folder/nikeshshakya sed -i 's/original/new/g' file.txt Explanation: sed = Stream EDitor -i = in-place (i.e. save back to the original file) The command string: s = the substitute command original = a regular expression describing the word to replace (or just the word itself) new = the text to replace it with g = global (i.e. replace all and not just the first occurrence) file.txt = the file name Or to make replace on all files on folder cd /path/to/your/folder/nikeshshakya sed -i 's/foo/bar/g' *...