Lab #1 - Installing CentOS 5.

5 into VMware 7 & sudo
Lab Steps:
I.

Stanislav

Configuring VMware 7 Workstation A. Select 'File'->'New'->'Virtual Machine'. B. Select 'Custom (advanced)' and click ʻNextʼ. C. Select 'Workstation 6.5-7.x' for hardware compatibility and click ʻNextʼ. D. Select 'I will install the operating system later.' and click ʻNextʼ. E. Select 'Linux' as the guest operating system and 'CentOS' as the version, then click ʻNextʼ. F. Name the virtual machine '412-CentOS-5.5'. Click ʻBrowseʼ and select your external hard drive. G. Create a new folder called '412-CentOS-5.5' and select it, then click ʻOKʼ. H. Verify your virtual machine name and location and then click ʻNextʼ. I. Leave the default selections for your processor configuration and click ʻNextʼ. J. Configure 1024 MB (1 GB) of memory for your virtual machine and click ʻNextʼ. K. Select 'Use bridged networking' and click ʻNextʼ. L. Leave the default I/O controller type set as-is and click ʻNextʼ. M. Select 'Create a new virtual disk' and click ʻNextʼ. N. Select 'SCSI' as the virtual disk type and click ʻNextʼ. O. Enter '10' for the GB of VM disk space. Select 'Split virtual disk into multiple files' and click ʻNextʼ. P. Accept the default disk file naming and click ʻNextʼ. Q. Review your virtual machine configuration and click Finish. R. Click 'Edit virtual machine settings' on the virtual machine configuration pane. S. Select 'CD/DVD (IDE)' and select 'Use ISO image file'. T. Click ʻBrowseʼ and pick the CentOS-5.5-i386-bin-DVD.iso file and click ʻOpenʼ and then click ʻOKʼ. U. Verify your 'CD/DVD (IDE)' line under the ʻDevicesʼ tab now has a file path to the ISO file.

II. Starting the CentOS 5.5 Installer A. Click ʻPower on this virtual machineʼ. B. When the installation screen is booted, type linux text at the 'boot:' prompt and choose ʻEnterʼ. C. Select 'Skip' on the CD Found dialog and select ʻEnterʼ. Select ʻEnterʼ to the ʻWelcomeʼ dialog. D. Select 'English' for your language and select ʻEnterʼ. E. Select 'us' for your keyboard type and select ʻEnterʼ. F. You will receive a 'Warning' dialog about erasing all data, select 'Yes' and choose ʻEnterʼ. II. Partitioning the Hard Drive & Configuring the Boot-Loader A. On the ʻPartition Typeʼ screen, select ʻCreate custom layoutʼ and choose ʻOKʼ. B. Select the line where it says ʻFreeʼ from the partition editor and choose ʻNewʼ. Configure the partition structure as listed below, making sure to setup the filesystem and partition size accurately. 1. Note: You will notice an ʻExtendedʼ partition structure for /dev/sda4; this is normal.
Mount Point / /usr /var /home None Filesystem Type ext3 ext3 ext3 ext3 swap Size 2048 MB 5120 MB 2048 MB 512 MB 509 MB

C. Review your partition layout with a classmate or the instructor and then choose ʻOKʼ. D. On the boot loader configuration screens (five of them in a row) just select ʻOKʼ for each.

III.

Basic Configuration Steps A. Select ʻYesʼ when asked if you would like to configure eth0 for a network interface. B. Make sure ʻActivate on bootʼ and ʻEnable IPv4ʼ support are selected and choose ʻOKʼ. C. Verify ʻManual address configurationʼ is chosen then set an IP address & netmask. Choose ʻOKʼ. D. Set your gateway and primary DNS settings and then choose ʻOKʼ. E. For hostname configuration, select the ʻmanuallyʼ option and type the proper hostname. F. Select ʻAmerica/Detroitʼ from the timezone list and then choose ʻOKʼ. G. Configure the systemʼs root password to be linuxlab and then choose ʻOKʼ. H. Uncheck all boxes on the package selection screen and choose ʻOKʼ. I. Select ʻOKʼ. The OS installation will begin and should finish in 5 - 10 minutes. Select ʻRebootʼ. Initial CentOS 5.5 Setup A. When the system reboots, CentOS 5.5 will automatically start. B. At the ʻSetup Agentʼ screen, select ʻExitʼ. C. Login as the root user account. D. Run useradd -c “Bob Jones” -m -s /bin/bash bjones replacing your information. E. Configure the newly created account with a password of your choosing with passwd bjones F. Exit your root account and login with your new account. Logout when you have tested it.# G. Within the VMware software, click the Snapshot button and call it “Base Installation”. Introduction to sudo A. Log into your created userʼs account. B. Become the root user, with a clean environment, using su - root C. Edit the sudoers configuration file using vim /etc/sudoers D. Scroll down into the file until you find this line: # root# ALL=(ALL)# ALL E. Add the following line under the line you just found. Replace the name with your own. # %elite# bjones.nita412.local=(ALL)# ALL F. Save the file using :wq! as it is read-only by default. This will override that setting temporarily. G. Add the required elite group for sudoers using groupadd elite H. Add your regular user to the elite group using usermod -a -G elite bjones I. Logout of your root user account, and then logout of your regular user account. J. Log into your regular user and type sudo su - root and use your regular userʼs password. K. You should now have a root prompt. Type whoami to verify that you are indeed the root user. L. Run the visudo command and view the contents. This is the proper way to edit /etc/sudoers. M. Close visudo and exit the root shell, back into your regular userʼs account. N. Execute the sudo -l command to see the list of your userʼs sudo privileges. O. Execute the following two commands and observe the differences in privilege: sudo -u sshd ls /root sudo -u root ls /root P. Logout of all of your shells and save your virtual machine -- call the snapshot ʻLab #1 Completedʼ

IV.

V.

# #

Master your semester with Scribd & The New York Times

Special offer for students: Only $4.99/month.

Master your semester with Scribd & The New York Times

Cancel anytime.