Tag Archives: CentOS

Loading IPTables Rules on Boot with CentOS/RHEL

Reloading iptables rules on boot for CentOS and RHEL is simpler than for most other Linux Distributions. RHEL and its clone CentOS write its “permanent” iptables rules to the  /etc/sysconfig/iptables file. Writing iptables rules is out of the scope of this article, so I won’t go over that today.

After you have applied your respective iptables rules, you may wish to check on your iptables rules before you save them. Use the following command to list all the current rules:

iptables -L

Use this command to save the iptables rules (the following command is the actual command to save the rules so they are applied on boot)

/sbin/service iptables save

The following command would allow you to double check that your rules have been saved. It is similar to iptables -L, but also different. The previous command shows all the rules that are currently in effect, but many of those rules will not be applied after your system has been restarted. The following command will show all the rules that are currently in effect and have been written to disk, meaning they will apply even after a reboot.

cat /etc/sysconfig/iptables

Starting Services on Boot with ntsysv on CentOS/RHEL/Fedora

ntsysv allows you to easily specify the scripts/services you want to automatically start on boot. For CentOS and RHEL users, you can easily install ntsysv using yum. This should work on Fedora too, as they are in the same boat as RHEL and CentOS. ntsysv is not available on Debian/Ubuntu natively, so this method of starting services won’t work.

yum install ntsysv

After you have installed it, run the ntsysv command.

ntsysv

You’ll be presented with a window that has a combination of red, blue, and gray.

Use the up/down arrow to navigate the list. Use the spacebar to check/uncheck a service. Use your tab to navigate to ‘Ok’ and ‘Cancel’. This part is mostly self explanatory.

Installing recordmydesktop on CentOS and RHEL

Recordmydesktop is a command line (and GUI) program that can be used to record a video of the CentOS Desktop (among other distros as well). To install it on CentOS, begin by installing the required dependancies:

yum install gcc make libXext-devel libSM-devel libICE-devel zlib-devel libXfixes-devel libXdamage-devel libvorbis-devel libtheora-devel

Because CentOS does not official an RPM for recordmydesktop, we will have to install it from source. We will download a tar of the source code, untar the source, and remove the tar file:

wget http://downloads.sourceforge.net/project/recordmydesktop/recordmydesktop/0.3.8.1/recordmydesktop-0.3.8.1.tar.gz
tar xf recordmydesktop-0.3.8.1.tar.gz
rm -rf recordmydesktop-0.3.8.1.tar.gz

Now, let’s go into the folder and install Recordmydesktop.

cd recordmydesktop-0.3.8.1
./configure
make
make install

If you did not set a custom prefix, running /usr/bin/recordmydesktop should begin recording your desktop! Use the following command (just as with most commands) to view the options available:

recordmydesktop --help