Red Hat Linux System Administration Examination Mock #2

1) Create users named anand, arun, deepak. Password for the users the username itself.
 

2) 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.
 

3) Using shell scripting add five users named mca1, mca2, mca3, mca4, mca5. The password for these users is 'mca'.
 

4) 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.
 

5) Create a crontab such that user arun gets the message ‘Good Evening’ every day at 11:30 PM at terminal tty2
 

6) 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.
 

7) Tar the directory /X under /groupmember and zip the tar file using of Bunzip2. ( Where X is 'Exam' )
 

8) Configure the yum client and install a package named ‘Open Office’.
Note: (yum server located at ftp://192.168.6.254/pub/client/Client )
 

9) Create a new directory named as 'localdisk' at /root . Make a new partition with 1 GB 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


Answers

1) useradd anand
    useradd arun
    useradd deepak
    passwd anand
    passwd arun
    passwd deepak
 

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

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

4). 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
 

5) crontab -eu arun
    30 11 * * * echo "Good Evening" > /dev/tty2

    service crond restart
 

6) 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

7) tar -cvf /groupmember/filename.tar /Exam
    cd /groupmember
    bzip2 filename.tar
 

8) 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
 

9) 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 vfat defaults 0 0
      /dev/sda< partition number> /linuxdisk ext3 defaults 0 0
      mount -a

Linux Tips

More Linux Questions

Have a Linux Problem
Linux Forum - Do you have a Linux Question?

Linux Books
Linux Certification, System Administration, Programming, Networking Books

Linux Home: Linux System Administration Hints and Tips

(c) www.gotothings.com All material on this site is Copyright.
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk.
All product names are trademarks of their respective companies.
The site www.gotothings.com is in no way affiliated with or endorsed by any company listed at this site.
Any unauthorised copying or mirroring is prohibited.