ComputerSecurityStudent (CSS) [Login] [Join Now]




|UNIX >> CentOS >> CentOS-6.6 >> Current Page |Views: 53069

(CentOS 6.6: Lesson 1)

{ Installing CentOS 6.6 }


Section 0. Background Information
  1. What is CentOS?
    • CentOS (abbreviated from Community Enterprise Operating System) is a Linux distribution that attempts to provide a free, enterprise-class, community-supported computing platform which aims to be functionally compatible with its upstream source, Red Hat Enterprise Linux (RHEL).

  2. Lab Notes
    • In this lab we will do the following:
      1. Download CentOS-6.6
      2. Install CentOS-6.6
      3. Customize File System Layout to use both fixed and Linux Volume Management (LVM) Partitions.
      4. Install and Test VMware Tools
      5. Install GCC (C++ Compiler)
     
  3. Legal Disclaimer
    • As a condition of your use of this Web site, you warrant to computersecuritystudent.com that you will not use this Web site for any purpose that is unlawful or that is prohibited by these terms, conditions, and notices.
    • In accordance with UCC § 2-316, this product is provided with "no warranties, either express or implied." The information contained is provided "as-is", with "no guarantee of merchantability."
    • In addition, this is a teaching website that does not condone malicious behavior of any kind.
    • You are on notice, that continuing and/or using this lab outside your "own" test environment is considered malicious and is against the law.
    • © 2014 No content replication of any kind is allowed without express written permission.

     

Section 1. Prerequisite
  1. On any Window's machine, download and install VMware Player, if you have not already done so.

     

  2. Locate CentOS Mirror Download

     

  3. Choose a CentOS Mirror
    • Instructions:
      1. Choose a Mirror

     

  4. Download CentOS-6.6 ISO
    • Instructions:
      1. Click on CentOS-6.6-i386-bin-DVD1.iso
      2. Click the Save File radio button
      3. Click the OK button

     

  5. Save CentOS-6.6 ISO
    • Instructions:
      1. Navigate to wherever you want to save the CentOS-6.6 ISO.
        • In my case, I am saving the ISO to my external USB E: Drive.
        • E.g., E:\CentOS-6.6\
      2. Click the Save Button

 

Section 2. Create a New Virtual Machine
  1. Open VMware Player on your windows machine.
    • Instructions:
      1. Click the Start Button
      2. Type "vmware player" in the search box
      3. Click on VMware Player

     

  2. Create a New Virtual Machine. (See Below)
    • Instructions:
      1. Click on Home
      2. Click on Create a New Virtual Machine
     
  3. Installation Media
    • Instructions:
      1. Select the radio button "I will install the operating system later"
      2. Click Next
    • Note(FYI):
      1. Normally, you would select "Install disc image file (iso)", but unfortunately VMware Player will attempt to do an easy install.

     

  4. Select a Guest Operating System
    • Instructions:
      1. Guest operating system:  Linux
      2. Version: CentOS
      3. Select Next

     

  5. Name the Virtual Machine
    • Instructions:
      1. Virtual machine name: CentOS-6.6
      2. Location: E:\CentOS-6.6
        • In my case, I saved it to my USB drive.
      3. Click the Next Button

     

  6. Specify Disk Capacity.
    • Instructions:
      1. Make the disk size to 20 GB.
      2. Select the radio button name Store virtual disk as a single file.
      3. Select Next.

     

  7. Customize the Hardware.
    • Instructions:
      1. Select the Customize Hardware Button.

     

  8. Configure Memory
    • Instructions:
      1. Click on Memory.
      2. Up the memory to 1 GB
      3. Do NOT Click the Close Button, we still have more to configure.

     

  9. Configure CD/DVD
    • Instructions:
      1. Click on CD/DVD.
      2. Select the radio button "Use ISO image file:"
      3. Click the Browse Button, and navigate to the CentOS-6.6-i386-bin-DVD1.iso and double click on it.
    • Note(FYI):
      1. Do NOT Click the Close Button, we still have more to configure.

     

  10. Configure the Network Adapter
    • Instructions:
      1. Click on Network Adapter
      2. Selected the Bridged radio button.
      3. Now, you can click the Close button.

     

  11. Click Finish (See Below)
    • Instructions:
      1. Click the Finish Button

     

Section 3. Install CentOS-6.6 to Hard Drive
  1. Start the CentOS-6.6 VM
    • Instructions:
      1. Click on the CentOS-6.6 VM
      2. Click on Play virtual machine

     

  2. Install CentOS-6.6
    • Instructions:
      1. Scroll up to "Install or upgrade an existing system" and press <Enter>

     

  3. Disc Found
    • Instructions:
      1. Right Arrow to the Skip Box and press <Enter>

     

  4. Select Next
    • Instructions:
      1. Click the Next Button

     

  5. Select Language
    • Instructions:
      1. Select English (English)
      2. Click Next 

     

  6. Select Keyboard
    • Instructions:
      1. Select English.
      2. Click Next

     

  7. Select Storage Device
    • Instructions:
      1. Select Basic Storage Devices
      2. Select Next

     

  8. Storage Device Warning
    • Instructions:
      1. Click the "Yes, discard any data" Button

     

  9. Name the server
    • Instructions:
      1. Hostname: centos66
      2. Click the Next Button.

     

  10. Select Time Zone
    • Instructions:
      1. Select the time zone of your choice.
      2. Select Next.

     

  11. Select a root password.
    • Instructions:
      1. Root Password:  <Supply A Strong Root Password>
      2. Confirm: <Re-Enter the previous Root Password>
      3. Click the Next Button
    • Note(FYI):
      • At least 8 characters
      • Alpha-Numeric
      • Uppercase and Lowercase
      • Symbols (!@#$%^&*, etc)

     

Section 4. Creation Partitions
  1. Create Custom Layout.
    • Instructions:
      1. Select Create Custom Layout
      2. Click the Next Button
     
  2. Create /boot (Part 1)
    • Instructions:
      1. Click on the Free Space under the SDA Hard Drive
      2. Click the Create Button
        • This will pop up a Create Storage window
      3. Click on the Radio Button "Standard Partition"
      4. Click on the Create Button

     

  3. Create /boot (Part 2)
    • Instructions:
      1. Mount: /boot
      2. File System Type: ext4 or ext2
        • ext2 is sufficient if you do not think your /boot file system will change.  For class purposes use ext4.
      3. Size: 500 (300 MB minimum)
      4. Addition Size Options: Select the Fixed size radio button
      5. Click OK
    • Note(FYI):
      1. The /boot partition holds the kernel and other data the system needs when it boots; it cannot be under the control of LVM. 

     

  4. Create / (Part 1)
    • Instructions:
      1. Click on the Free Space under the SDA Hard Drive
      2. Click the Create Button
        • This will pop up a Create Storage window
      3. Click on the Radio Button "Standard Partition"
      4. Click on the Create Button
     
  5. Create / (Part 2)
    • Instructions:
      1. Mount: /
      2. File System Type: ext4
      3. Size: 4000 (Recommend: (3.0 GB - 5.0 GB)
      4. Additional Size Options: Select the Fixed size radio button
      5. Click OK
    • Note(FYI):
      1. Any file systems that are not created as a separate partition will become automatically part of the root(/) filesystem.

     

  6. Create swap (Part 1)
    • Instructions:
      1. Click on the Free Space under the SDA Hard Drive
      2. Click the Create Button
        • This will pop up a Create Storage window
      3. Click on the Radio Button "Standard Partition"
      4. Click on the Create Button

     

  7. Create swap (Part 2)
    • Instructions:
      1. File System Type: swap
      2. Size: 3000 (Swap should double memory).
        • Currently, 1 GB is allocated to memory.  Only a maximum of 1.5 GB can be allocated to memory, since swap is 3000 MB or 3 GB
      3. Additional Size Options: Select the Fixed size radio button
      4. Click OK.
    • Note(FYI):
      1. Linux temporarily stores programs and data on a swap partition when it does not have enough RAM to hold all the information during processing.  Also, swap is used when your hibernate the system.

     

  8. Create a Physical Volume (Part 1)
    • Instructions:
      1. Click on the Free Space under the SDA Hard Drive
      2. Click the Create Button
        • This will pop up a Create Storage window
      3. Click on the Radio Button "LVM Physical Volume"
      4. Click on the Create Button

     

  9. Create a Physical Volume (Part 2)
    • Instructions:
      1. Additional Size Options: "Fill to maximum allowable size" radio button
      2. Click OK

     

  10. Create a Logical Volume Group
    • Instructions:
      1. Click on the sda5 physical volume
      2. Click the Create Button
        • This will pop up a Create Storage window
      3. Click on the Radio Button "LVM Volume Group"
      4. Click on the Create Button

     

  11. Create /usr
    • Instructions:
      1. Click the Add Button
      2. Mount: /usr
      3. Size: 4500 (4 to 16 GB)
      4. Click OK
    • Note(FYI):
      1. The size of /usr depends on the number of software packages you install

     

  12. Create /home
    • Instructions:
      1. Click the Add Button
      2. Mount: /home
      3. Size: 2000
      4. Click OK
    • Note(FYI):
      1. Size depends on the number of users on the machine and the type of work they do.

     

  13. Create the /tmp filesystem.
    • Instructions:
      1. Click the Add Button
      2. Mount: /tmp
      3. Size: 1000 (Minimum 500 MB)
      4. Click OK
    • Note(FYI):
      1. Temporary files such as *.pid files reside here.  For most Linux and Unix operating systems, data is not preserved between reboots.

     

  14. Create the /var filesystem
    • Instructions:
      1. Click the Add Button
      2. Mount: /var
      3. Size: 4000 (Required minimum is 500 MB; however, Apache and MySQL is typically installed under /var).
      4. Click OK, in the Make Logical Volume
      5. Click OK, in the Make Logical Volume Group
    • Note(FYI):
      1. /var is short for variable.  Data in this partition changes frequently.
        • /var/www/html - Where Apache Web Pages are stored.
        • /var/log - Where the system log messages are stored.
        • /var/mail - Where mail is stored

     

  15. Review Your Work
    • Note(FYI):
      1. Both /boot and / are fixed file systems which cannot be changed.
      2. /home, /usr, /tmp, and /var are LVM file systems which can be increased or decreased in size.
    • Instructions:
      1. Click the Next Button

     

  16. Format Warning
    • Instructions:
      1. Click the Format Button

     

  17. Writing storage configuration to disk
    • Instructions:
      1. Click the Write changes to disk Button

     

  18. Install the boot loader
    • Instructions:
      1. Check the Install boot loader checkbox
      2. Click the Next Button

     

  19. Install Software
    • Instructions:
      1. Click the Desktop radio button
      2. Click the Customize later radio button
      3. Click the Next Button

     

  20. Install Software
    • Instructions:
      1. Click the Desktop radio button

     

  21. Reboot System
    • Instructions:
      1. Click the Reboot button

 

Section 5. Post CentOS Configuration
 
  1. Welcome
    • Instructions:
      1. Click the Forward Button

     

  2. License Information
    • Instructions:
      1. Click "Yes, I agree to the License Agreement"
      2. Click the Forward Button

     

  3. Create User
    • Instructions:
      1. Username: student
        • Do not change "student", since this account is required for future labs.
      2. Full Name: Security Student
        • Replace Security Student with your actual full name.
        • e.g., John Gray
      3. Password:  <Supply A Strong Password>
      4. Confirm: <Re-Enter the previous Password>
      5. Click the Forward Button
    • Note(FYI):
      • At least 8 characters
      • Alpha-Numeric
      • Uppercase and Lowercase
      • Symbols (!@#$%^&*, etc)

     

  4. Date and Time
    • Instructions:
      1. Adjust the Date and Time and click the Forward Button

     

  5. Kdump (Part 1)
    • Note(FYI):
      1. CentOS 6 requires 4 GB of RAM.  Since, we only reserved 1 GB of memory for this virtual machine, you will receive and error message "Insufficient memory to auto-enable kdump".
    • Instructions:
      1. Click the OK Button in the Insufficient memory warning window.

     

  6. Kdump (Part 2)
    • Note(FYI):
      1. After clicking the Finish Button your machine will immediately reboot
    • Instructions:
      1. Click the Finish Button

 

Section 6. Install VMware Tools
 
  1. Login to CentOS
    • Note(FYI):
      1. Until you click the user, in this case Security Student, the Password field will not be displayed.
    • Instructions:
      1. Click on Security Student
        • This will display the password text box.
      2. Supply its' password
      3. Click the Log In Button

     

  2. Launch Install VMware Tools...
    • Instructions:
      1. Press the <Ctrl> and <Alt> keys
        • The will bring mouse focus back to your host machine
      2. Click on Player --> Manage --> Install VMware Tools...

     

  3. Open a Terminal
    • Instructions:
      1. Applications --> System Tools --> Terminal

     

  4. View VMware Tools Mount Location
    • Instructions:
      1. su - root
      2. Password: <Supply the root password>
      3. df -k
    • Note(FYI):
      1. su - root, means switch user to root.
      2. df -k, means to view file system disk space in the block size.
      3. Notice, VMware Tools was mounted to /dev/sr0 and is accessible in the directory /media/VMware Tools.

     

  5. Uncompress VMWare Tools Bundle
    • Instructions:
      1. cd /media/VMware\ Tools/
      2. ls -lrta
      3. cp VMwareTools*gz /var/tmp/
      4. cd /var/tmp
      5. tar zoxvf VMwareTools*gz
    • Note(FYI):
      1. cd, means to change directory.
      2. ls, means to list the directory contents.
        • -lrta, (l) long listing, (r) in reverse order by (t) time, and show (a) invisible files.
      3. cp, means to copy the VMWare Tools bundle to the /var/tmp directory.
      4. cd, means to change directory to the /var/tmp directory
      5. tar, means to uncompress or compress files or directories.  In our case we are going to uncompress the VMware Tools Bundle.
        • zoxvf, (x) means to extract and (z) unzip the (f) file in (v) verbose mode while keeping the same (o) ownerships.

     

  6. Install VMware tools
    • Instructions:
      1. cd vmware-tools-distrib/
      2. perl vmware-install.pl default

     

  7. Review Installation Output
    • Note(FYI):
      1. Scroll towards the bottom of the output for a completion message.
      2. In order for "all" of the vmware tool features to be invoked we will later reboot the machine in a later step.

 

Section 7. Post Virtual Machine Settings Configuration
 
  1. Open Virtual Machine Settings
    • Instructions:
      1. Press the <Ctrl> and <Alt> keys to bring mouse focus back to the host machine.
      2. Player --> Manage --> Virtual Machine Settings...

     

  2. Change CD/DVD Settings
    • Note(FYI):
      1. Below we want the Virtual Machine to boot from its' hard drive instead of the CentOS ISO.
    • Instructions:
      1. Click on CD/DVD (IDE)
      2. Click on the radio button "Use physical drive:"
      3. Select "Auto detect"
      4. Click the OK Button

 

Section 8. Reboot Machine
 
  1. Open a Terminal
    • Instructions:
      1. Applications --> System Tools --> Terminal

     

  2. Reboot Server
    • Instructions:
      1. su - root
      2. Password: <Supply the root password>
      3. reboot

 

Section 9. Verify VMware Tools is working
 
  1. Login to CentOS
    • Note(FYI):
      1. Until you click the user, in this case Security Student, the Password field will not be displayed.
    • Instructions:
      1. Click on Security Student
        • This will display the password text box.
      2. Supply its' password
      3. Click the Log In Button
     
  2. Resize Window
    • Instructions:
      1. Try to resize the Window, by dragging the bottom right corner of the window.  If scroll bar disappear, then you have verified VMware Tools is now installed.
    • Note(FYI):
      1. If scroll bar disappear, then you have verified VMware Tools is now installed.

     

Section 10: Install GCC
  1. Open a Terminal
    • Instructions:
      1. Applications --> System Tools --> Terminal
     
  2. Switch User to Root
    • Instructions:
      1. su - root
      2. Provide the Root Password

     

  3. Finding the GCC Compiler
    • Instructions:
      1. yum list | grep gcc
    • Note(FYI):
      1. Yum, is the package manager for Fedora, CentOS and RedHat.
      2. yum list, displays all the repository packages to the screen
      3. | grep gcc, filters the output to only display lines that contains the string gcc.

     

  4. Install GCC
    • Instructions:
      1. yum install gcc.i686
      2. Is this ok [y/N]: y
      3. You will see this question "Is this ok [y/N]:" four more times, please answer "y" to all questions.

     

Section 11: Proof of Lab
  1. Start Up a Terminal Window
    • Instructions:
      1. Applications --> Terminal

     

  2. Proof of Lab
    • Instructions:
      1. tail -1 /etc/passwd
        • Where "1" is a one.
      2. tune2fs -l /dev/sda1 | grep "Filesystem created:"
      3. date
      4. echo "Your Name"
        • Put in your actual name in place of "Your Name"
        • e.g., echo "John Gray"
    • Proof of Lab Instructions
      1. Press the <Ctrl> and <Alt> key at the same time.
      2. Press the <PrtScn> key.
      3. Paste into a word document
      4. Upload to Moodle

     



Help ComputerSecurityStudent
pay for continued research,
resources & bandwidth