Professional Documents
Culture Documents
If you are looking for a tool to monitor and display HDD and SSD health and failures under
Fedora 21 or older, I suggest that you trySmartmontools which is used to prevent hard disk or
SSD failure and it will give you the most accurate disk health rating.
Smartmontools will verify the health status of your hard drive by inspecting the SMART status of
the drive. The user will be warned if an error or some unexpected behaviors is detected before
it's too late (data loss).
Smartmontools Installation
To install Smartmontools on Fedora 21 or older, open terminal and issue this command:
Device Model:
HARDDISK
Serial Number:
09497d65-843b8578
User Capacity:
Sector Size:
Device is:
To check the health status of your hard disk, run this command:
smartctl -h
Fill up the form. After filling form you will be provided with username and password for the base machine.
Here provide password is for local user, not admin.
Login to the base machine.
After login to the base machine you are suppose to see a file on the Desktop in which information
regarding the exam is given.
There is also an icon on the Desktop by clicking which you will be able to access your Virtual
Machine.
You will solve all the questions in virtual machine.
As there is no Browser installed on Virtual Machine, you are supposed to open your exam paper in
Base Machine.
The packages can be installed using FTP from ftp://192.168.0.254/pub/rhel6/dvd
RHCSA PAPER
1). First step is to crack password of Virtual Machine
On start up the cpu press E (for edit)
Now go to on second line
Press E(for edit)
Now give space and write 1(or s) then press enter
Now press b
Now we change password for root
setenforce 0
passwd root
reboot
2). setup a ip addr for virtual macine as ip addr 192.168.0.y subnet mask 255.255.255.0
Iptables F
Service iptables save
Service iptables restart
Chkconfig iptables on
Your system has a new physical partition mounted under /common with a 400MiB ext4
file system.
[Note: Because partition sizes are seldom exactly whatever specified when they are
created, anything within the range of 350 to 450MB is acceptable.]
Fdisk l /dev/vda
Fdisk /dev/vda
N
E
3
9837
Whole memory
Enter
W
Fdisk /dev/vda
N
L
Enter
+400M
w
Partx a /dev/vda
Mkfs.ext4 /dev/vda5
Mkdir /common
Vim /etc/fstab
/dev/vda5
/common
ext4
defaults
00
Mount a
Df h
4). Create the following users, groups, and group memberships:
Mkdir /common/admin
Chgrp sysadmin /common/admin
Ll d /common/admin
Click on link
After that you will find two rpm packages
1) Kernel 2) kernel Firmware
Download both of them on desktop
First install kernel-firware
Now install kernel
Just by double click on them
Entries of kernel will be in vim /boot/grub/grub.conf
7). Enable IP forwarding on your machine
net.ipv4.ip-forward=1
Implement a web server for the site http://serverx.example.com then perform the
following steps:Download ftp://instructor.example.com/pub/rhce/station.html
Rename the downloaded file to index.html
Copy this index.html to the Document Root of your web server
Do NOT make any modifications to the content of index.html
Yum install httpd* y
Cd /var/www/html
Wget
ftp://instructor.example.com/pub/rhce/station.html
Ls
Mv station.html index.html
Service httpd restart
Chkconfig httpd on
W
Lvdisplay
Df h
Umount /dev/vgsrv/home
E2fsck f /dev/vgsrv/home
Resize2fs /dev/vgsrv/home 150M
Lvreduce L 150M /dev/vgsrv/home
Mount a
Lvdisplay
Df h
10).
Booleans on of Selinux
getsebool -a | grep ftp (1,5)
setsebool P Boolean name on
The user natasha must configure a cron job that runs daily at 14:23 local time and
executes /bin/echo hiya
Crontab u natasha e
23 14 * * * /bin/echo hiya
Service crond restart
Chkconfig crond on
Crontab u natsah -l
Copy the file /etc/fstab to /var/tmp. Configure the permissions of/var/tmp/fstab so that:
The file /var/tmp/fstab is owned by the root user.
The file /var/tmp/fstab belong to the group root.
The file /var/tmp/fstab should not be executable by anyone.
The user natasha is able to read and write /var/tmp/fstab.
The user sarah can neither write nor read /var/tmp/fstab.
[Note: all other users (current or future) have the ability to read/var/tmp/fstab.]
Cp /etc/fstab /var/tmp
Ll /var/tmp/fstab
Setfacl m u:Natasha:rw- /var/tmp/fstab
Setfacl m u:sarah:--- /var/tmp/fstab
Getfacl /var/tmp/fstab
Ntpdate b 192.168.0.254
Server 192.168.0.254
Service ntpd start
Chkconfig ntpd on
Find files in your system which is owned by natasha user & copy all the files on
/backup/somefile directory
w
Find / -user natasha
Find / -user Natasha -exec cp -rvf {} /backup/somefile/ \;
Mkdir p /backup/somefile;find / -user Natasha exec cp a rvf {} /backup/somefile \;
Ls l /backup/somefile/
Create a SWAP partition of 450 megabyte and make available at next reboot.
Free m
Fdisk /dev/vda
N
L
+450M
T
6
82
W
Partx a /dev/vda
Mkswap /dev/vda6
Swapon /dev/vda6
Free m
Vim /etc/fstab
/dev/vda6
00
Mount a
Free m
Su ldapuser7
Here is showing error. For removing error we make directory & mount server directory on this
Mkdir p /home/guest/ldapuser7
Mount 192.168.0.254:/home/guests/ldapuser7
/home/guests/ldapuser7
Su ldapuser7
Logout
/etc/auto.misc
-rw,soft,intr
instructor.example.com:/home/guests/ldapuser7
Create the following user name neo with uid 1337 and set the password
password:
Useradd u 1337 neo
Tail -1 /etc/passwd
Passwd neo
Password
Create the volume group with name myvol with 8 MiB P.E. and create the lvm
name mydatabase with the 20 P.E. and format this lvm with vfat and create a
directory /database and mount this lvm permanently on /database.
Fdisk /dev/vda
N
L
+167M
T
7
8e
W
Partx a /dev/vda
Pvcreate /dev/vda7
Vgcreate s 8M myvol /dev/vda7
Vgdisplay Myvol
Lvcreate L 160M n mydatabase myvol
Lvdisplay
Mkfs.vfat /dev/myvol/mydatabase
Mkdir /database
Vim /etc/fstab
/dev/myvol/mydatabase
/database
vfat
defaults
00
Mount a
Df h
Find the string root from /etc/passwd file and save the result in /searchfile.
Grep root /etc/passwd > /searchfile
Cat /search
/usr/local/sbin/install-vserver( for Installation virtual machine)
RHCE PAPER
Two Network have been given here
example.com-------192.168.0.0/255.255.255.0
cracker.org---------172.24.0.0/255.255.0.0
iptables -F
service iptables save
service iptables restart
chkconfig iptables on
Now create yum
1). Configure SSH access
Configure SSH access as follows:
sarah has remote SSH access to your machine from within example.com
Clients within cracker.org should NOT have access to ssh on your System
vim /etc/ssh/sshd_config
allowusers sarah root
here we use TCP wrapper secruity. we make some entries as such follows
vim /etc/hosts.allow
sshd: 192.168.0.0/255.255.255.0
vim /etc/hosts.deny
sshd: 172.24.0.0/255.255.255.0
service sshd restart
chkconfig sshd on
2). Restrict crontab
User neo should not be able to use crontab.
for this make entries in below mentioned file
vim /etc/cron.deny
neo
service crond restart
chkconfig crond on
3). Configure FTP access
Configure FTP access on your system:
Clients within the example.com domain should have anonymous FTP access to your machine
Clients outside example.com should NOT have access to your FTP service.
mkdir /common
yum install samba* -y
vim /etc/samba/smb.conf
workgroup=STAFF
[common]
path=/common
browseable=yes
valid users=sarah
hosts allow=192.168.0.0/255.255.255.0
read only=yes
useradd sarah
smbpasswd -a sarah
ls -lz /etc/samba/smb.conf
ll dZ /common
ll dZ /etc/samba
chcon -t samba_etc_t /common
service smb restart
chkconfig smb on
smbclient //192.168.0.110/common -U sarah
wget ftp://instructor.example.com/pub/rhce/station.html
mv station.html index.html
vim /etc/httpd/conf/httpd.conf
NameVirtualHost 192.168.0.110:80
<virtualhost 192.168.0.110:80>
Document Root /var/www/html
servername server10.example.com
</virtualhost>
service httpd restart
chkconfig httpd on
clients http://server10.ecample.com
mkdir /var/www/virtual
cd /var/www/virtual
wget ftp://instructor.example.com/pub/rhce/www.html
mv www.html index.html
vim /etc/httpd/conf/httpd.conf
NameVirtualHost 192.168.0.110:80
<virtualhost 192.168.0.110:80>
Document Root /var/www/html
servername server10.example.com
</virtualhost>
<virtualhost 192.168.0.110:80>
Document Root /var/www/virtual
servername www10.example.com
</virtualhost>
yum
install
httpd*
-y;mkdir
/var/www/html/restrict;cd
ftp://instructor.example.com/pub/rhce/station.html; mv station.html index.html;
/var/www/html/restrict;wget
vim /etc/httpd/conf/httpd.conf
<Directory /var/www/html/restrict>
order allow,deny
allow from 192.168.0.0
</Directory>
Export your /common directory via NFS to the example.com Domain only.
[Note: because you will not have root access, you will not be able to directly
Mount your exported /common directory using your guest account on the system
provided for testing. However, the auto-mounter on the system has been
configured such that it will automount your /common directory under
/home/guestx/nfs/stationx, where x is your station number. Consequently,
successful execution of ls /home/guestx/nfs/stationx indicates that the
automounter was able to automount your NFS share.]
Rpm q nfs-utils
Yum install nfs-utils
Vim /etc/exports
/common 192.168.0.0/255.255.255.0(ro,sync)
Service nfs restart
Chkconfig nfs on
Configure an email alias for your MTA such that mail sent to admin is received by the
local user sarah.
Vim /etc/aliases
Admin:
/mnt/iso
iso9660
defaults,loop,ro
00
Mount a
Df h
12). Configure an iscsi
Dicover an ISCSI device on your system and create a partition on that device of size 10
MiB mounted under directory /iscsi. Create a file named abc.txt in /iscsi directory.
Configure permission of that file such that user sarah can read, write and execute this file.
yum install iscsi-initiator-utils y
iscsiadm m discovery -t st -p 192.168.0.254:3260
Trying to login with the iSCSI
Now copy iqn.2012-10.com.example:disk1
Iscsiadm -m node -T iqn.2012-10.com.example:disk1 -p 192.168.0.254:3260 -l
fdisk l
fdisk /dev/sda
make 10MB partition
partprobe /dev/sda
mkfs.ext4 /dev/sda1
Checking the UUID for disk
blkid /dev/sda1
now copy UUID="71e86162-011d-49f1-9b4a-9f95a277e6b5"
Add the next entry in /etc/fstab file
Vim /etc/fstab
UUID=71e86162-011d-49f1-9b4a-9f95a277e6b5
/iscsi
ext4 defaults,_netdev,acl 0 0
Mkdir /iscsi
Mount a
Df h
Cd /iscsi/
Touch abc.txt
Setfacl m u:sarah:rwx /iscsi/abc.txt
13). Configure
script
Sh script.sh
14). Pass the parameter to kernel
Pass the parameter to kernel.
Pass the parameter "kernelbp=1" to the kernel.
Enter this value at the last of the line kernel in /etc/grub.conf
Vim /etc/grub.conf
Now save and restart the machine
And now check with this
Cat /proc/cmdline