Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Fill the form with your name / address / email Agree with the rules and accept it
* login in runlevel 5 with GUI with root:
- change the root password to "V2nCda10".
- assign the static ip
Ip : 192.168.0.X (X is your station number)
Netmask : 255.255.255.0
Gateway : 192.168.0.1
DNS : 192.168.0.254
- Set the Hostname stationX.example.com
Ans.
root@station1 ~]#echo "V2nCda10" | passwd --stdin root
root@station1 ~]#vim /etc/sysconfig/network-scripts/ifcfg-eth0
- & do following changes:
BOOTPROTO="static"
IPADDR="192.168.0.X"
NETMASK="255.255.255.0"
Gateway="192.168.0.1"
:wq
root@station1 ~]# vim /etc/resolv.conf
search example.com
nameserver 192.168.0.254
:wq
Q.6 The user andrew must configure a cron job that runs daily at 15:25 local time
and executes
- /bin/echo hello >>/dev/tty1
Ans.
root@station1 ~]#crontab -u paula -e
25 15 * * * /bin/echo hello >>/dev/tty1
root@station1 ~]#service crond restart; chkconfig crond on
Q.7 Configure your machine as LDAP client. LDAP server and LDAP directory tree
information will be given in the exam.
- ldapuserX should be able to log into your system, where X is your station
number, but will not have
a home directory until you have completed the autofs requirement.
- All ldapuser users have a password of password
Ans.
root@station1 ~]#system-config-authentication
--> On the Identity & Authentication tab, select User A/C Configuration
check box, choose LDAP for User A/C
Database
--> Configure LDAP Search Base DN with: dc=example,dc=com
--> Configure LDAP Server with the URI: ldap://instructor.example.com
--> Select Use TLS to encrypt connections and Click Download CA Certificate
--> Enter Certificat URL: http://instructor.example.com/pub/EXAMPLE-CA-CERT
& click ok
--> Enable LDAP under Authentication Configuration & Click Apply button.
root@station1 ~]#getent passwd ldapuserX [ To check client & server mapping ]
* Now check by logging through ldapuserX (Suppose you are sitting at station2
then your user will be ldapuser2)
* the password of ldapuser2 is password
Q.8 Configure autofs to automount the home directories of LDAPUSER users. Note the
following:
- server1.example.com (192.168.0.254) NFS-exports /home/guests for ldapuser,
- ldapuserX's home directory is server1.example.com:/home/guests/ldapuserX,
where X is your station number
- ldapuserX's home directory should be automounted locally beneath
/home/guests as /home/guests/ldapuserX
- home directories must be writable by their users.
- while you are able to log in as any of the user ldapuser1 through
ldapuser20, the only home directory that is
accessible from your system is ldapsuserX
* Example: station2 would configure the automounter such that ldapuser2's home
directory /home/guests/ldapuser2 gets mounted
automatically upon login. The NFS share would be:
- instructor.example.com:/home/guests/ldapuser2.
Ans.
root@station1 ~]# vim /etc/auto.master
/home/guests
/etc/auto.guests
Note: * ( /home/guests which is in your system )
* ( /etc/auto.guests this is new file which we create & we provide the
info. to the client that what is
coming from the LDAP Server. )
root@station1
root@station1
root@station1
root@station1
root@station1
Q.14 Resize the LVM using the GUI tool by the PE value.
Q.15 Create a swap partition of 756M MB and make it available permanent.
[ Pattern - 1 ]
Ans.
root@station1 ~]# fdisk /dev/vda
command ( m for help ):n
[ To make new partition ]
First Cylinder: <Leave Blank>
Last Cylinder:+756M
command ( m for help ):w
root@station1 ~]#reboot
[ To active new partition table ]
* After reboot run following command to make swap partition for
permanent: root@station1
root@station1
root@station1
root@station1
~]#mkswap /dev/vdaN
[ Where N is your partiton number ]
~]#swapon /dev/vdaN
[ Where N is your partiton number ]
~]#swapon -s
[ To check new swap partition is active or not ]
~]#vim /etc/fstab
[ To make swap partition for permanent ]
/dev/vdN
swap
swap
default
0 0
:wq
[ To save & exit fstab file ]
[ Pattern - 1 ]
root@station1 ~]#cd /
root@station1 ~]#dd if=/dev/zero of=swapfile bs=756M count=1
root@station1 ~]#mkswap swapfile
root@station1 ~]#swapon swapfile
root@station1 ~]#swapon -s
root@station1 ~]#vim /etc/fstab
[ To make swap partition for permanent ]
/swapfile
swap
swap
default
0 0
:wq
[ To save & exit fstab file ]
Q.16 Configure Internet web server for your domain. Download the index.html from
the server
(IP and location will be specified in the exam) into the default
document root of the server
- Download ftp://instructor.example.com/pub/rhce/station.html
- Rename the downloaded file to index.html
- Copy this index.html file to the DocumentRoot of your web server
- Do NOT make any modifications to the content of index.html
Ans.
root@station1 ~]#yum install httpd -y
root@station1 ~]#cd /var/www/html
root@station1 ~]#lftp instructor.example.com/pub/rhce
root@station1 ~]#lftp instructor.example.com:/pub/rhce> get station.html
root@station1 ~]#lftp instructor.example.com:/pub/rhce> bye
root@station1 ~]#mv station.html index.html
root@station1 ~]#vim /etc/httpd/conf/httpd.conf
root@station1 ~]#sysctl -p
Q.3 Configure SSH access as follows
- susan has remote SSH access to your machine from within example.com
- Clients within my133t.org should NOT have access to SSH on your system
Ansroot@station1 ~]#vim /etc/ssh/sshd_config
AllowUsers susan root
:wq
root@station1 ~]#vim /etc/hosts.deny
sshd:ALL EXCEPT .example.com
:wq
You may use whatever you want
root@station1 ~]# iptables -A INPUT -s 192.168.0.0/24 -p tcp --dport 22 -j ACCEPT
root@station1 ~]# iptables -A INPUT -s 192.168.0.0/24 -p udp --dport 22 -j ACCEPT
root@station1 ~]#chkconfig sshd on ;/etc/init.d/sshd restart
Q.4 Configure POP3 email on your system according to these criteria:
- brad must be able to retrieve email from your machine using POP3 from within
example.com
- Clients within my133t.org domain should not have access to your POP3 service
Ansroot@station1 ~]#yum install dovecot
root@station1 ~]#vim /etc/dovecot/dovecot.conf
protocols = imap pop3
:x
root@station1 ~]#/etc/init.d/dovecot restart;chkconfig dovecot on
root@station1 ~]#iptables -F
root@station1 ~]#iptables -A INPUT ! -s 192.168.0.0/24 -p tcp --dport 22 -j REJECT
root@station1 ~]#iptables -A INPUT ! -s 192.168.0.0/24 -p udp --dport 22 -j REJECT
root@station1 ~]#service iptables save
Q.5 Configure FTP access on your system:
- Clients within the example.com domain should have anonymous FTP access to your
machine.
- Clients outside example.com domain should not have access to your FTP service
Ansroot@station1
root@station1
root@station1
root@station1
Configure Internet web server for your domain. Download the index.html from
server.
and location will be specified in the exam) into the default document root of
server
- Download ftp://instructor.example.com/pub/rhce/station.html
- Rename the downloaded file to index.html^M
- Copy this index.html file to the DocumentRoot of your web server
- Do NOT make any modifications to the content of index.html
ftp>bye
root@station1 ~]#vim /etc/httpd/conf/httpd.conf
NameVirtualHost 192.168.0.17:80
(enter your ip address before port 80)
#
#
#
#
#
VirtualHost example:
Almost any Apache directive may go into a VirtualHost container.
The first VirtualHost section is used for requests without a known
server name.
<VirtualHost 192.168.0.17:80>
(again enter your ip address before port 80)
ServerAdmin root@desktop17.example.com
DocumentRoot /var/www/html
(Define here your document root)
ServerName desktop17.example.com
(Define here your website name)
DirectoryIndex index.html
(Define here directory index)
</VirtualHost>
:wq
root@station1 ~]#/etc/init.d/httpd restart;chkconfig httpd on
Q.8 Export your /shared directory via NFS to the example.com domain only:
- You can check your shared directory but shoumount will not allow becuse you
login from local user
- You may check by using /net directory
Ansroot@station1 ~]#vim /etc/exports
/shared
*.example.com(rw,sync)
:wq
root@station1 ~]#chkconfig nfs on
root@station1 ~]#service nfs restart
root@station1 ~]#cd /net/192.168.0.17
root@station1 ~]#ll
total 0
dr-xr-xr-x. 3 root root 0 Jul 28 19:44 shared
Q.9 Configure an email alias for your MTA such that mail sent to acctmgr is
received by the local user paula.
Ansroot@station1 ~]#vim /etc/aliases
acctmgr: paula
:wq
root@station1 ~]#newaliases
Q.10 Configure SMTP mail service according to the following requirements:
- Your mail server should accept mail from remote hosts and localhost
- susan must be able to receive mail from remote hosts
- Mail delivered to susan should spool into the default mail spool for
susan, /var/spool/mail/susan
root@station1 ~]#yum install postfix
root@station1 ~]#vim /etc/postfix/main.cf
myhostname = desktop17.example.com
(set your hostname)
mydomain = example.com
(define your domain name)
myorigin = $mydomain
(set myorigin)
inet_interfaces = all
(uncomment this line)
#inet_interfaces = localhost
(comment this line)
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux Server (2.6.32-71.el6.x86_64.debug)
root (hd0,0)
kernel /vmlinuz-2.6.32-71.el6.x86_64 ro root=/dev/mapper/vol0-root
rd_LVM_LV=vol0/root rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8
SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us crashkernel=auto
sysctl=1
rhgb quiet
initrd /initramfs-2.6.32-71.el6.x86_64.img
:wq
root@station1 ~]#cat /proc/cmdline
ro root=/dev/mapper/vol0-root rd_LVM_LV=vol0/root rd_NO_LUKS rd_NO_MD rd_NO_DM
LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us
crashkernel=129M@0M sysctl=1 rhgb quiet
Q.13 Create a script that should print foo or bar when user input foo or bar
otherwise show something else.
Ansvim script.sh
#!/bin/bash
F1=$1
if [ $F1 == foo ];then
echo "bar"
elif [ $F1 == bar ];then
echo "foo"
else
echo "Please Type foo or bar"
fi
:wq
root@station1 ~]#sh script.sh foo
bar
root@station1 ~]#sh script.sh bar
foo
root@station1 ~]#sh script.sh data
Please tyep foo or bar
Q.14 Mount a iso file placed at /root permanently to a directory /mnt/data.
Ansroot@station1 ~]#ls -l /root/oracle6i.iso
-rw-r--r--. 1 root root 196976640 Jul 28 20:13 /root/oracle6i.iso
root@station1 ~]#vim /etc/fstab
/root/oracle6i.iso
/mnt/data iso9660 ro,loop 0 0
:wq
root@station1 ~]#mount -a
Q.15 Configure yourself as ISCSI initiator to the ISCSI target
instructor.example.com. Then create a partition of 1200MB and mount it under
/mnt/data1.
Ansroot@station1 ~]#yum install iscsi-initiator-utils
/mnt/data1
ext4 _netdev 1 2
Q.16 The user paula should not have permission to schedule a cron job.
Ansroot@station1 ~]#vim /etc/cron.deny
paula
:wq
root@station1 ~]#/etc/init.d/crond restart;chkconfig crond on
Q.17 Extend your website. Create a directory in document root name as secret.
Placed document root in configuration file as
/var/www/html/secret. This web-site should be access on your local host
and should be acces on others.
Ansroot@station1 ~]#mkdir /var/www/html/secret
root@station1 ~]#vim /var/www/html/secret/index.html
local wesite
:wq
BEST OF LUCK