Showing posts with label Exam Objective. Show all posts
Showing posts with label Exam Objective. Show all posts

Tuesday, 4 November 2014

Install and configure MariaDB.

This is a fairly easy objective:

Run the following command to install MariaDB:
sudo yum -y install mariadb mariadb-server
 To start and enable it so that it starts again post reboot:
systemctl start mariadb.service
systemctl enable mariadb.service
Finally, run this script (and follow the steps therein) to finalize the installation:
mysql_secure_installation 
I'm not entirely, if anything else is required by this objective to be honest and I'm a bit rusty with Linux, which is why I started with something easy.

Monday, 18 July 2011

NTP -- Synchronize time using other NTP peers

Let's start by configuring an NTP server. You can install the ntp server with:
yum install ntp -y
Make sure that it starts on system start up:
chkconfig ntp on
Open the firewall and save the changes:
 iptables -I INPUT -p udp --dport ntp -j ACCEPT; service iptables save
Edit the ntp config file /etc/ntp.conf and add the following line:
restrict 10.168.20.0 mask 255.255.255.0 nomodify notrap
This will allow any client in the 10.168.20.0 network to get its time from the ntp server, except that it does not quite do it for me, as I don't have an internet connection. This is because a local server is way down in the pecking order or stratum, so a few extra steps are required:
echo "10.168.20.227" >> /etc/ntp/step-tickers
echo "10.168.20.227" >> /etc/ntp/ntpservers
Assuming that 10.168.20.227 is the ip address of your ntp server. You can now start your ntp server with:
service ntpd start
Interestingly, there are no SELinux settings related to ntp and you can block hosts by using iptables rules.

In order to configure a client to use this ntp server, simply add the following line to the ntp config file of your server:
server 10.168.20.227
Set the ntp daemon to start at boot time and start the service:
chkconfig ntpd on
service ntpd start
You can now use the following command to check the configuration is working:
ntpq -p
which should have a result like this:

          remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 10.168.20.227   LOCAL(0)        11 u   45   64    1    0.479  263675.   0.000

Sunday, 17 July 2011

SSH -- Configure additional options described in documentation

How long is a piece of string?

All I can say about this objective, is that you had better familiarize yourself with the SSH daemon config file (/etc/ssh/sshd_config) and the manual pages (man sshd & man sshd_config) as well as the ssh client config (/etc/ssh/ssh_confg) and manual pages (man ssh & man ssh_config).

Saturday, 16 July 2011

SSH -- Configure key-based authentication

This is actually a fairly simple objective. The default configuration is to accept key-based authentication, note this line on the /etc/ssh/sshd_config file:
#PubkeyAuthentication yes
Although the line is commented out, this is actually the default and as such does no need to be explicitly stated, if you wanted to prevent key based authentication, just add this line:
PubkeyAuthentication no
At any rate back to the objective. On the client, issue the following command, and follow the instructions, to generate a key:
ssh-keygen
Note that you don't actually need to add a passphrase, just press enter. This will allow you to login without being prompted for a passprhase.

The last step is to copy the public key that you have just generated to the server you want to login to:
ssh-copy-id  user@<servername>
That's it, if you did not provide a passphrase, you should be able to login with:
ssh user@<servername>
Note, that both ssh-keygen and ssh-copy-id have several options and that you should study them to see what they do.

I guess that in the exam you could be asked to install ssh, even if it does get installed by default. At any rate, just issue the following command:
yum install openssh-server -y
You should then make sure that it is set to run at boot time:
chkconfig sshd on
You can allow ssh traffic through by opening port 22:
iptables -I INPUT -p tcp --dport 22 -j ACCEPT; service iptables save
Depending on your configuration, you might need to change SELinux settings. You can check the SELinux settings like this:
getsebool -a | grep ssh
Finally, you can limit the users that can login by using the DenyUsers directive in the  /etc/ssh/sshd_config file like so:
DenyUsers naughtyuser
Remember to restart the daemon after any changes:
service sshd restart
If you want to prevent hosts from accessing SSH, you can do it by using iptables rules, e.g.:
iptables -I INPUT -p tcp --dport 22 -s 10.168.20.233 -j DROP; service iptables save
I think this pretty much covers this objective.

SMTP -- Configure an MTA to forward (relay) email through a smart host

This is actually quite simple. You need to modify the following line in the postfix config file (/etc/postfix/main.cf):
relayhost = 10.168.20.227
This will relay emails to host 10.168.20.227, which means that this host needs to be configured as Postfix server, see my previous post here.

Note that you still need to change other configuration settings as detailed in my previous post.

Saturday, 9 July 2011

SMTP -- Configure a mail transfer agent (MTA) to accept inbound email from other systems

Postfix is normally installed by default, but just in case it isn't, you can install it with:
yum install postfix mailx -y
mailx is useful to test that you have configured Postfix correctly. You will need to open port 25 for Postfix to work properly, like this:
iptables -I INPUT -p tcp --dport 25 -j ACCEPT; service iptables save
There only appears to be a single SELinux setting related to Postfix, and it seems to be switched on by default:
allow_postfix_local_write_mail_spool --> on
Make sure that Postfix will run when the server reboots and start the service:
chkconfig postfix on
service postfix start
Finally, if you want to prevent users from sending emails, you could add the following directive to the Postfix config file:
smtpd_recipient_restrictions =
        check_sender_access hash:/etc/postfix/restricted_senders
You can now add any users you want to prevent from sending email by adding them to this file like this:
 testuser@dev.com reject
The usual suspects covered let's get back to the objective. You'll need to edit the postfix configuration file (/etc/postfix/main.cf) and make sure you set and uncomment the following settings:
myhostname = redhat.dev.com
mydomain = dev.com

myorigin = $mydomain
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
You can now restart postfix and test your configuration remotely, see this post for details.

Friday, 8 July 2011

SMB -- Provide network shares suitable for group collaboration

In sharp contrast to the similar objective for NFS, this objective is clearly defined and easily achievable.

I have added a group called Users to my system and created a few users giving them the group Users as a supplemental group (e.g. useradd -G Users auser). Created a samba password for these users and then added the following to my /etc/samba/smb.conf file:
[myothershare]
browseable=yes
path = /myshareddirectory
force group = +Users
valid users = @Users myuser
write list = @Users
create mask = 0770
force create mode =660
Now, let's set SELinux settings (I'm assuming that you have already set samba_export_all_ro as per my previous post):
 setsebool -P samba_export_all_rw 1
And the security context type:
 chcon -t samba_share_t /myshareddirectory/
Let's set ownerships and permissions:
   chgrp Users /myshareddirectory/
   chmod -R 770 /myshareddirectory/
You can now,assuming that your server is 192.168.1.64, finally, mount the share with (you might need to install cifs-utils):
mount.cifs //192.168.1.64/mycolshare /test -o user=myuser
When you create a file now it should have rw permissions for both owner and group and thus files should be read and writeable for any users in the Users group.
-rw-rw----. 1 502 501 0 Jul  8 20:45 createdbyanotheruser
-rw-rw----. 1 501 501 0 Jul  8 21:02 createdbyauser

SMB -- Provide network shares to specific clients

The crux of this objective lies with the /etc/samba/smb.conf file, which is where all the samba (smb shares are configured).

In order to install samba, just issue the following command:
yum install samba -y
You will need to open the firewall for ports 139 & 445 (don't forget to save it):
iptables -I INPUT -p tcp --dport 139 -j ACCEPT
iptables -I INPUT -p tcp --dport 445 -j ACCEPT
Make sure that samba starts with the system:
chkconfig smb on
chkconfig nmb on
There are a few SELinux settings related to samba(default settings):
samba_create_home_dirs --> off
samba_domain_controller --> off
samba_enable_home_dirs --> off
samba_export_all_ro --> off
samba_export_all_rw --> off
samba_run_unconfined --> off
samba_share_fusefs --> off
samba_share_nfs --> off
use_samba_home_dirs --> off
virt_use_samba --> off
Note, that there is a bit off information regarding SELinux contexts on the samba config file.

You can now start samba with:
service smb start; service nmb start
Let's get back to the objective, say you want to create a share called myshare to all clients in your network, you'll need to edit /etc/samba/smb.con like this:
[myshare]
        comment=A share for me
        path = /myshareddirectory
        browseable = yes
        writable = no
        valid users=myuser
        hosts allow = 192.168.1. 10.168.1.65
        hosts deny = 192.168.1.33
This share will be available to all hosts in 192.168.1.0, except for 33 and also to 10.168.1.65.
You'll need to set the following SELinux setting to allow to list the files:
setsebool -P samba_export_all_ro 1
and if you want to set the share as writable, you'll also need this:
setsebool -P samba_export_all_rw 1
Remember to change the security context type of your shared directory, in my case:
chcon -t samba_share_t /myshareddirectory
You need to add the samba user myuser:
smbpasswd -a myuser
You can now,assuming that your server is 192.168.1.64, finally, mount the share with (you might need to install cifs-utils):
mount.cifs //192.168.1.64/myshare /test -o user=myuser

Thursday, 7 July 2011

NFS -- Provide network shares suitable for group collaboration

At first, I thought that this was in essence the same objective as Create and configure set-GID directories for collaboration, where the folder that you set up is also shared and writeable to everybody, ie chmod 4777, but I'm not sure that this is actually the case, as you are depending on the user's umask to set the right permissions for the files created, in other words you need to make the files world writeable.

An alternative is to set the uid and gid of the anonymous user so that they match the owner of the share, but this is also the same as making it world writable, just a little bit more elegantly and you still need to set up the directory for collaboration in the NFS server, if that is indeed required. In a similar vein, you can change the shared directory's ownership to nfsnobody.

It is worth bearing in mind that NFS works using uid and gids, so that if you set the gid (or the uid) to 514 and the client does not have a group with gid 514 it won't know who to match, so you will get permissions errors. More intriguingly, if you set  an (either anonuid or anongid) on the share (e.g. home/col *(rw,sync,anongid=514)) and create a file with a user that has uid =gid=501 and has 514 as a secondary group, the file will belong to user with uid=501 in the server, which may or may not be the same user as in the client. In other words, this needs some sort of directory service to work properly, which to me sounds more complicated than the average objective, even for the RHCE exam.

Thus, in essence, in other for this to work properly you need to have both server and client being member of a domain, then set up group collaboration on a share where the group owner is a domain group and finally simply export the share, which al seems way beyond the average objective as I said above.

Since I've meaning for a while to write a post about setting openLDAP up, so once this is done, I will update this post.

Wednesday, 6 July 2011

NFS -- Provide network shares to specific clients

The crux of this objective lies with the /etc/exports file, which is where all the available nfs shares are configured.

In the exam you might have to install nfs, which you can do with:
yum install nfs-utils -y
You will need to open the firewall for port 2049 (don't forget to save it):
iptables -I INPUT -p tcp --dport nfs -j ACCEPT
iptables -I INPUT -p udp --dport nfs -j ACCEPT
Make sure that nfs starts with the system (Make sure the rpcbind is also set to start with the system):
chkconfig nfs on
chkconfig nfslock on
There are a few SELinux settings related to nfs (default settings):
allow_ftpd_use_nfs --> off
allow_nfsd_anon_write --> off
git_system_use_nfs --> off
httpd_use_nfs --> off
nfs_export_all_ro --> on
nfs_export_all_rw --> on
qemu_use_nfs --> on
samba_share_nfs --> off
use_nfs_home_dirs --> on
virt_use_nfs --> off
xen_use_nfs --> off
You can now start nfs with:
service nfs start
Let's get back to the objective, say you want to share directory /distro to all clients in your network, you'll need to edit /etc/exports like this (assuming that your network is 10.168.20.0):
/distro  10.168.20.0/24(ro)
Note that there is no space between the address/mask and the export options. Similarly, if you just want to share to a single client you can specify it by ip address or hostname or even fqdn, like this:
/distro 10.168.20.225(ro,sync)
/distro rhel6test.dev.com(ro,sync)
/distro 10.168.20.225(ro,sync) rhel6test.dev.com(ro,sync)
/distro 10.168.20.0/24(ro,sync) rhel6(ro,sync)
Note that the third line is the same as the first two lines combined and the fourth is just another example of how options can be combined.
You can now export the filesystems and restart nfs with:
exportfs -av; service nfs restart

Friday, 1 July 2011

FTP -- Configure anonymous-only download

This objective has mostly been covered here. This time I tried from a different server to test the server and I had this strange behaviour:
ftp 10.168.20.233
Connected to 10.168.20.233 (10.168.20.233).
220 (vsFTPd 2.2.2)
Name (10.168.20.233:root): anonymous
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
227 Entering Passive Mode (10,168,20,233,38,221).
ftp: connect: No route to host
ftp> cd pub
250 Directory successfully changed.
ftp> ls
227 Entering Passive Mode (10,168,20,233,161,152).
ftp: connect: No route to host
ftp> pwd
257 "/pub"
After a bit of hunt, I discovered that the ip_conntrack_ftp module is needed for passive mode to work properly, thus:
modprobe ip_conntrack_ftp; service vsftpd restart
It works fine now:
ftp 10.168.20.233
Connected to 10.168.20.233 (10.168.20.233).
220 (vsFTPd 2.2.2)
Name (10.168.20.233:root): anonymous
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
227 Entering Passive Mode (10,168,20,233,141,198).
150 Here comes the directory listing.
drwxr-xr-x    2 0        0            4096 May 26  2010 pub
226 Directory send OK.
Now, we just need to make it permanent, which requires a script to be written. Note that this needs to have a .modules extension and be placed in the /etc/sysconfig/modules directory:
#!/bin/sh
exec /sbin/modprobe ip_conntrack_ftp >/dev/null 2>&1
I have called mine ip_conntrack_ftp.modules thus in order to make it executable, I issue this command:
chmod +x  /etc/sysconfig/modules/ip_conntrack_ftp.modules
Note that there are no SELinux settings related to this objective and that in order to prevent hosts from accessing the service you should use an iptables rule. User based authentication is enabled by default, as local users are enabled by default (local_enable=YES), but in order to allow access to them you will need to set this SELinux setting:
setsebool -P ftp_home_dir 1
To me this conflicts with the objective of configuring anonymous-only download, but would seem to satisfy Configure host-based and user-based security for the service, so it's hard to say for sure

Thursday, 30 June 2011

DNS -- Configure a caching-only name server to forward DNS queries

Hot on the heels of my previous post comes this one. Assuming that you have followed the previous post simply, add the following lines to your /etc/named.conf file in the options section (change the ip address to whatever you dns server is):
forwarders {10.168.20.233;};
forward only;
Restart the bind daemon and off you go.

Note that since we are actually forwarding name queries, there is no need to modify the /var/named/named.ca file, like I had to do in the previous post.

DNS -- Configure a caching-only name server

I must confess, yet again, that I'm not 100% sure what this objective refers to. My understanding is as follows: A caching server is, as its name indicates, used to cache queries, therefore an authoritative server is needed to first provide the actual answer that will be cached by this server, so far so good. I think this is geared towards having a single DNS server within an organization, so that internet name queries are cached on this server.

My RHEL6 boxes don't have internet access, so this has been a little bit awkward for me to test. I essentially set up a master DNS server and then modified the /var/named/named.ca file in the caching name server, where I changed the ip address of one the servers to be my master dns server, like this:

M.ROOT-SERVERS.NET.     3600000 IN      A       10.168.20.233
I think I might be getting a little bit ahead of myself. Let's start from the beginning and install Bind:
yum install bind -y
You'll now need to edit the bind configuration file /etc/named.conf and make a few changes:
listen-on port 53 { any; };
allow-query     { any; };
Given the fact that I had not configured DNSSec properly I also commented the dnssec lines out.
/*      dnssec-enable yes;
        dnssec-validation yes;
        dnssec-lookaside auto;
*/
Ensure that the Bind daemon is set to run at boot time:
chkconfig named on
Open up the firewall and save the changes:
iptables -I INPUT -p udp --dport 53 -j ACCEPT; iptables -I INPUT -p tcp --dport 53 -j ACCEPT;service iptables save
You can now start named:
service named start
The best way to test this is to use dig and look at the times it takes to run a query. In my case, I can just turn off the master dns server and if the results are cached, then I will get a response, e.g.:
dig myserver.domain.com
;; Query time: 2 msec
;; SERVER: 10.168.20.234#53(10.168.20.234)
dig myserver.domain.com
;; Query time: 0 msec
;; SERVER: 10.168.20.234#53(10.168.20.234)
This feels a little bit unsatisfying, so I used the tc command to add a 200 milisecond delay to all traffic on eth0 (note that this is done in the master dns server)

tc qdisc add dev eth0 root netem delay 200ms
I bounced the caching server and tried again with dig:
dig myserver.domain.com
;; Query time: 202 msec
;; SERVER: 10.168.20.234#53(10.168.20.234)
dig myserver.domain.com
;; Query time: 0 msec
;; SERVER: 10.168.20.234#53(10.168.20.234)
A lot better this time :). It now makes a bit more sense to have a caching name server.

Note that the cache is stored in memory and therefore will disappear after a reboot of the server or of named itself, see here.

Also note, that there are no SELinux settings related to this objective and that in order to prevent hosts from accessing the service you should use an iptables rule.

Saturday, 25 June 2011

HTTP/HTTPS -- Configure group-managed content

I must confess that I'm not sure what this objective refers to. I initially thought this referred to group authentication, however when I tried to find other what other people were saying I came up empty. This blog does not cover it, neither does this one. It does not seem to be covered by this book. I was about to give up, when I found this blog, where the objective is simply to set up a directory that is configured for collaborative editing.
Note that there is an error, step four should use chown rather than chgrp.

Friday, 24 June 2011

HTTP/HTTPS -- Deploy a basic CGI application

This is actually a surprisingly easy objective to achieve. Create a script in the /var/www/cgi-bin directory, like this and call it uptime.cgi:
#!/bin/bash
echo "Content-type: text/html"
echo ""
echo "Uptime is:  $(uptime)"
If you move/copy the script from a different directory or you use a different directory, the SELinux context is likely to be wrong and will need to be changed, so bear that in mind.

Make the script executable:
chmod +x uptime.cgi
You can now test your new cgi script with:
elinks 127.0.0.1/cgi-bin/uptime.cgi
You might want to add the following directives to a different directory to enable script execution and allow other script extensions.
Directory Options +ExecCGI 
AddHandler cgi-script pl cgi
Note that the . before the file extension is not needed and that the extensions are case insensitive.

HTTP/HTTPS -- Configure private directories

I'm not 100% sure whether this objective refers to making the home directory of system users available via Apache or simply to configuring a private area, whose access is controlled via user name. I will cover the former in this post and refer you to this post for the latter.

Again we'll be editing the httpd config file (etc/httpd/conf/httpd.conf). Make sure that you have the following directives set:
UserDir public_html
 #  UserDir disabled
And then simply uncomment the example provided, which will give you read access to the user files:
<Directory /home/*/public_html>
    AllowOverride FileInfo AuthConfig Limit
    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
    <Limit GET POST OPTIONS>
        Order allow,deny
        Allow from all
    </Limit>
    <LimitExcept GET POST OPTIONS>
        Order deny,allow
        Deny from all
    </LimitExcept>
</Directory>
You'll now need to create a public_html directory for all users and make sure that permissions and SELinux are configured correctly. This is for a user called myuser.
mkdir /home/myuser/public_html;chmod 701 /home/myuser; chmod 705 /home/myuser/public_html
Now create a test page and give it the right permissions:
echo 'A Simple User Page' >> public_html/index.html; chmod 604 public_html/index.html
Finally, set the SELinux settings to enable home directories:
setsebool -P httpd_enable_homedirs 1
and change the user contexts to the Apache user context (you can get this command from the manual page for httpd_selinux):
 chcon -R -t httpd_sys_content_t /home/myuser/public_html
Restart Apache and you should be able to visit myuser's fancy page:
elinks 127.0.0.1/~myuser
You can create by public_html directory and even a simple page for all new users by modifying the skeleton directory, like so:
mkdir /etc/skel/public_html
echo 'A Simple User Page' >> public_html/index.html;
chmod -R 705 /etc/skel/public_html/
This only helps for new users, but for existing users the process could be scripted like this:
#!/bin/bash 
if [ -n "$1" ]
then
  user=$1
else
   echo "Usage prepare username"
exit
fi

##Set appropriate permissions for home directory
chmod 701 /home/$user

##Create public_html
mkdir /home/$user/public_html

##Create Index.html file
echo "A Simple User Page for $user" >> /home/$user/public_html/index.html;

##Change permissions and ownership
chown -R $user:$user /home/$user/public_html
chmod -R 705 /home/$user/public_html/

##Change SELinux context
chcon -R -t httpd_sys_content_t /home/$user/public_html
This script can be improved by looping through the accounts and checking that public_html does not exist, but it does the work.

Thursday, 23 June 2011

HTTP/HTTPS -- Configure a virtual host

If you are coming from a Windows background virtual hosts are the equivalent of hosting several websites using host headers.
In my case I have created a couple of CNAME aliases on my DNS server for 10.168.20.225, so that rhel6virtual.dev.com and rhel6morevirtual.dev.com both point to 10.168.20.225, the ip address of the Apache server. You can replicate this by modifying your /etc/hosts file if you don't want to be using a DNS server. Note that this needs to be added to the client too.

I can now edit the Apache config file (/etc/httpd/conf/httpd.conf) like this:
NameVirtualHost *:80

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot /var/www/rhel6virtual/
    ServerName rhel6virtual.dev.com
    ErrorLog logs/rhel6virtual
    CustomLog logs/rhel6virtual common
</VirtualHost>
<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot /var/www/rhel6morevirtual
    ServerName rhel6morevirtual.dev.com
    ErrorLog logs/rhel6mv
    CustomLog logs/rhel6mv common
</VirtualHost>
I now create the DocumentRoot directories:
mkdir /var/www/rhel6virtual; mkdir /var/www/rhel6morevirtual
and add a file to each directory to allow easy testing:
  echo "More Virtual" > /var/www/rhel6morevirtual/index.html; 
  echo "Virtual" > /var/www/rhel6virtual/index.html
You can now restart Apache:
httpd -k restart
So now if you visit http://rhel6virtual.dev.com/index.html you'll see a web page that simply says Virtual and if you visit http://rhel6morevirtual.dev.com/index.html you'll see a web page that simply says More Virtual.

Installing Apache has already been covered here. You can check the rather long list of SELinux settings with:
getsebool -a | grep httpd
For an explanation of what each settings does, check this manual page out:
man httpd_selinux
In order to prevent access to the websites you can use iptables (don't forget to save the configuration), e.g.
 iptables -I INPUT -p tcp --dport 80 -s 10.168.20.0/24 -j DROP
or you can edit the configuration file for Apache, add the following to the second virtual host from above:
 <Directory "/var/www/rhel6morevirtual/">
         Options            Indexes FollowSymLinks
         AllowOverride      None
         Order              deny,allow
         Allow              from 10.168.20.203
         Deny from all
    </Directory>
Only 10.168.20.203 can see rhel6morevirtual now.

In order to prohibit users from accessing the web server, you first need to allow users to use it, so add a user and password with the following command (The -c creates the file, so it's only needed the first time):
 htpasswd -cm /etc/httpd/conf/apachepass myuser
Now, edit the Apache config file and inside the directory directive for "/var/www/rhel6morevirtual/" add:
AuthType Basic
AuthName "Restricted Files"
AuthUserFile /etc/httpd/conf/apachepass
Require user myuser
Restart Apache and now the only user that can see rhel6morevirtual will be myuser.

Note that an alternative to this method is to use the .htaccess file. In this method  we create an .htaccess file on the target directory /home/myuser/public_html/ in my case.

Edit the .htaccess file and enter the following :
AuthType Basic
AuthName "Restricted to myuser"
AuthUserFile /home/myuser/public_html/.htauthusers
Require valid-user
You now need to run:
htpasswd -c .htauthusers myuser
If you try to visit the page, you'll be prompted for a username and password. The beauty of this method is that it allows users without root access to restrict access to "their" web site.

Wednesday, 22 June 2011

Configure a system to accept logging from a remote system

As I said in my previous post this should be combined with this objective, Configure a system to log to a remote system. At any rate, in order to configure a system to accept logging from a remote system, you need to edit the /etc/rsyslog.conf file.

Remove the comments from these lines to activate TCP remote logging.
#$ModLoad imtcp.so
#$InputTCPServerRun 514
so that they look like this
$ModLoad imtcp.so
$InputTCPServerRun 514
Open the firewall and save the configuration change to the firewall:
iptables -I INPUT -p tcp --dport 514 -j ACCEPT; service iptables save
All that remains is to restart the logging daemon:
service rsyslog restart
Note that you could use UDP instead or as well as TCP. The rsyslog manual is your friend.

Configure a system to log to a remote system

I sometimes wonder about Red Hat. This objective is meaningless without the next objective, Configure a system to accept logging from a remote system, so why just not combine them? I guess that if they did that, it would cut down in the number of objectives and make the exam look too easy, who knows?

At any rate, provided that you have achieved the next objective [sic] this one should be very easy to achieve. You need to edit the /etc/rsyslog.conf file and add the following line at the end of it:
*.* @@10.168.20.233:514
The above assumes that you want to log everything to a server on 10.168.20.233 on port 514. It is of course possible to simply log a category, e.g. mail, cron, authentication, etc.. Use the next line to log authentication to the same server:
authpriv.*                                            @@10.168.20.233:514
All that remains is to restart the logging daemon:
service rsyslog restart
You can test that the system is logging to the remote server with:
logger "remote logger"
Incidentally, the logger command is very good for adding logging to bash scripting, so be sure to remember it.

Use shell scripting to automate system maintenance tasks

This is by far the most open objective for any of the two exams. Frankly, I think this objective should be better defined. Yes, RHCEs should be expected to know a significant amount of shell scripting but by leaving this objective defined in such a open fashion it risks people spending too much time on time, probably not a bad thing in itself, or none at all.

At any rate, if you have never done any shell scripting, I recommend this tutorial, continued here. If you are familiar with the basics or even if you are not, you can follow this guide. I've also been looking at this book. I don't endorse it or not endorse it, it just came up on a search of books24x7.com.