Vous êtes sur la page 1sur 6

RED HAT LINUX ESSENTIALS AND SYSTEM

ADMINISTRATION EXAMINATION
Reg.No & Name :_______________________________________________
Machine No: _______

Duration: 2hours

1) Installation requirements: / -20000MB, /boot -128MB, /home -2048MB, Swap


4000MB. Firewall should be disabled, SElinux should be in disabled, and select I
will register later. Password for user root should be RedHat@MCA. Your ip
address should be configuring through DHCP. ( NFS directory path to
/var/ftp/pub/server5.4 and NFS server Name as 192.168.6.254.)
Note: Installation should be done through the NFS and use custom partition.
2) Change the system run level to 3 and reboot your system.
Note: Try to answer all the questions in a virtual console Ctrl + Alt + F1.
3) Create a directory named X under /. ( Where X is Exam. )
4) Copy the directory /boot/grub with its contents to /X and rename it to Sample.
( Where X is Exam. )
5) Change your current working directory to Sample. Create empty files named first,
second, third , fourth, fifth, sixth
6) Using numeric method to change the permission to the files first, second, third such
that user should have read, write and execute permission. Group members should
have read and execute permission. Others should have read and execute permission.
7) Using symbolic method to change the permission to the files fourth, fifth, sixth such
that user should have read, write permission. Group members should not have write
and execute permission. Others should not have any permission.
8) Using cat command to create files named bca, mca with the content This is file
for bca students and This is file for mca student.
9) Create a soft link file slbca at /mnt for bca and create a hard link file hlmca at
/opt for mca.

10) Create users named anand, arun, deepak. Password for the users the username itself.
11) Create a group named redhat. The user anand and deepak should be the members of
the group redhat. Assign the directory /groupmember to linux group. The directory

/groupmember should be accessible only to the group members of redhat.


12) Using shell scripting add five users named mca1, mca2, mca3, mca4, mca5. The
password for these users is mca.
13) The bootproto should be static Permanently change your hostname to
examX.mca.org, and your ipaddress should be 192.168.6.X. where X is last two
digits of your Reg. number.
14) Create a crontab such that user arun gets the message Good Evening every day at
11:30PM at terminal tty2
15) Using newusers command create users named red1, red2, red3. Password for the
users is hat. While Switch to that users it should successfully log on and show the
username and station name on bash prompt.
16) Tar the directory /X under /groupmember and zip the tar file using of Bunzip2.
( Where X is Exam. )
17) Configure the yum client and install a package named Open Office.
Note: (yum server located at ftp://192.168.6.254/pub/client/Client )
18) Create a new directory named as localdisk at /root . Make a new partition with
1GB with the VFAT (Windows FAT LBA)file system and it should be permanently
mounted at /root/localdisk . Make Another 1GB partition on Linux file system it
should be permanently mounted at /linuxdisk.

Note: After completing twenty questions reboot your system then type the following
command:
history > /root/Desktop/reg.no
df h >> /root/Desktop/reg.no
cat /proc/swaps >> /root/Desktop/reg.no
runlevel >> /root/Desktop/reg.no
ll /Exam/Sample >> /root/Desktop/reg.no
ll /mnt >> /root/Desktop/reg.no
ll /opt >> /root/Desktop/reg.no
tail -20 /etc/group >> /root/Desktop/reg.no
ls /home >> /root/Desktop/reg.no
cat /etc/sysconfig/network >> /root/Desktop/reg.no
cat /etc/sysconfig/network-scripts/ifcfg-eth0 >> /root/Desktop/reg.no
crontab -lu arun >> /root/Desktop/reg.no
ll -a /home/red1 >> /root/Desktop/reg.no
ll -a /home/red2 >> /root/Desktop/reg.no
ll -a /home/red3 >> /root/Desktop/reg.no
ll /groupmember >> /root/Desktop/reg.no
rpm qa openoffice* >> /root/Desktop/reg.no
df h /root/localdisk >> /root/Desktop/reg.no
df h /linuxdisk >> /root/Desktop/reg.no
cat /etc/fstab >> /root/Desktop/reg.no

ANSWER
1.

insert boot disk and type linux askmethod


Select the installation method as NFS and configure the IP as through the dhcp.
Assign the NFS directory path to /var/ftp/pub/server5.4 and assign the NFS server
Name as 192.168.6.254.
df -h

2.

vim /etc/inittab

3.

mkdir /Exam

4.

cp -r /boot/grub /Exam/sample

5.

cd /Exam/sample
touch first second third fourth fifth sixth

6.

chmod 755 first


chmod 755 second
chmod 755 third

7.

chmod u+rw,g+r,o-rwx fourth


chmod u+rw,g+r,o-rwx fifth
chmod u+rw,g+r,o-rwx sixth

8.

cat > bca


type the content and then press ctrl+d to save
cat > mca
type the content and then press ctrl+d to save

9.

ln -s /Exam/sample/bca /mnt/slbca
ln /Exam/sample/mca /opt/hlmca

10.

useradd anand
useradd arun
useradd deepak
passwd anand
passwd arun
passwd deepak

11.

groupadd redhat
usermod -G redhat anand
usermod -G redhat deepak
mkdir /groupmember
chgrp redhat /groupmember
chmod 770 /groupmember

12.

vim script.sh
#!/bin/bash
for USERS in mca1 mca2 mca3 mca4 mca5
do
useradd $USERS
echo mca | passwd --stdin $USERS
done

13.

vim /etc/sysconfig/network
HOSTNAME=examX.mca.org
vim /etc/sysconfig/network-scripts/ifcfg-eth0
BOOTPROTO=static
IPADDR=192.168.6.X
NETMASK=255.255.255.0
GATEWAY=192.168.6.254

14.

crontab -eu arun


30 11 * * * echo "Good Evening" > /dev/tty2
service crond restart

15.

vim <filename>
red1:hat:601:601::/home/red1:/bin/bash
red2:hat:602:602::/home/red2:/bin/bash
red3:hat:603:603::/home/red3:/bin/bash
newusers <filename>
cp rf /etc/skel/.* /home/red1
cp rf /etc/skel/.* /home/red2
cp rf /etc/skel/.* /home/red3
su red1

16.

17.

tar -cvf /groupmember/filename.tar /Exam


cd /groupmember
bzip2 filename.tar
vim /etc/yum.repos.d/<name>.repo
[Server]
baseurl=ftp://192.168.6.254/pub/client/Client
gpgcheck=0
[VT]
baseurl=ftp://192.168.6.254/pub/client/VT
gpgcheck=0

18.

mkdir /root/localdisk
mkdir /linuxdisk
fdisk /dev/sda
options -- n
-- l
-- press enter key
-- +1024M
-- t
-- partition number
-- c
options -- n
-- l
-- press enter key
-- +1024M
-- t
-- partition number
-- 83
-- w
partprob
sync
mkfs.vfat /dev/sda<partition number>
mkfs.ext3 /dev/sda<partition number>
partprob
sync
vim /etc/fstab
/dev/sda< partition number>
/root/localdisk
/dev/sda< partition number>
/linuxdisk
mount -a

vfat defaults
ext3 defaults

0 0
0 0

Vous aimerez peut-être aussi