Franske CNT-2311 Labs

From ITCwiki
Revision as of 19:41, 3 February 2011 by BenFranske (talk | contribs) (→‎Chapter 3: btrfs needs package)
Jump to navigation Jump to search

Chapter 1

  1. Install the Fedora Linux distribution into a new virtual machine.
  2. Login to your Ubuntu Linux server virtual machine using your standard username and password
  3. Experiment with moving from directory to directory on the system
    1. Try to get to the /etc, /usr/bin and /var/cache/man directories on your system. How can you verify which directory you are currently working in?
    2. Try using a shortcut to get back to your the home directory of your user.
  4. Create a new directory inside of your home directory called linuxlabs and another new directory inside of that directory called chapter01
  5. Make chapter01 your working directory and create three empty files within that directory named one, two, and three using the touch command.
  6. View a long style listing of all files (including hidden files) in the current directory to verify the three files were created and each have a size of zero.
  7. Set an environment variable called MYNAME equal to your name and then use the echo command to display a customized greeting using the environment variable you just set.
  8. The dmesg command will display the system kernel log. Capture the standard output from the dmesg command into a new file named kernel-log.
  9. Rename the kernel-log file to startup-log and the one file to number-name
  10. Use the nano text editor to edit the number-name file to include the information from your textbook listing 1.1 found on page 19. Create another new file named number-status with the information from listing 1.2 on the same page.
  11. Use the join command to match the data in the number-name file with that in the number-status file and capture the result into a new file named number-name-and-status
  12. Use the man command to review the manual pages of the less command
  13. Copy the /var/log/syslog file into a new file ~/linuxlabs/chapter01/system-log-file
  14. Try using some of the other text processing commands including sort, nl, head, tail, grep, etc. to manipulate data on files in your chapter01 directory.

Chapter 2

  1. Install Fedora as a second virtual machine if you have not done so already
    1. Use a web browser in Fedora to download an RPM file from the Internet
      • One possible example is the zsh-4.3.10-5.fc14.i686.rpm file which can be found through the rpmfind.net site.
    2. Use the RPM utility to query for information about the RPM package
    3. Install the RPM package you downloaded in Fedora
    4. Use yum to check which packages installed on your system have updates available using the yum check-update command
    5. Try using the appropriate yum command to update one of those packages to the latest version
  2. Switch to your Ubuntu Server VM
    1. Use a text editor to edit your /etc/apt/sources.list file and change the repository from us.archive.ubuntu.com to mirror.rit.edu (HINT: You can use the search and replace function of your text editor to do this quickly! Also, I suggest making a backup copy of your original /etc/apt/sources.list file before making any changes)
    2. Use the apt-get update or aptitude update command to download the latest package lists from the repository
    3. Use the apt-get install or aptitude install commands to download and install the links and lynx text-only web browser programs.
    4. Use ldd to get information about what libraries some program on your system uses
    5. Use ps and top to view all the processes running on your system
    6. Use job control to start and stop jobs as well as run jobs in the background and list all currently running jobs
      • An example of a job you could stop is cat /var/log/syslog | less which displays your entire system log one line at a time. You should be able to start this job in the background using cat /var/log/syslog | less& and then view a list of active jobs on your system, bring it to the foreground, stop the job and then start it again in the background
  3. Don't forget to shutdown your systems properly (shutdown -h now) before closing the VM windows.

Chapter 3

  1. Create a new 6 GB virtual hard drive file and add it as a secondary hard drive to your Ubuntu Server VM
  2. Boot your Ubuntu Server system
  3. Use the dmesg command to check for log messages from the kernel during system startup. Try to find some information about the second hard drive you just added.
  4. Find and partition the new drive into at least 5 partitions
    1. Make the first partition an ext3 partition
      • Set this partition so that it will never automatically run fsck
    2. Make the second partition a swap partition.
      • HINT: You will need to change the partition type, format the partition as swap space, and enable the swap space. You can verify the swap space is active and in use by using the free -m command before and after you setup this partition.
    3. Make the third partition an ext2 partition
    4. Make the fourth partition a btrfs partition
      • HINT: btrfs is a fairly new filesystem and the tools to format a btrfs partition may not be installed by default. Try searching for packages which you could install to add btrfs support to your system.
    5. Make the fifth partition a msdos (FAT) partition
  5. Create mount points (empty directories) for each of the non-swap partitions within your home directory and mount the partitions.
    • Examples:
    • partition 1 mounted to /home/student/businessfiles
    • partition 3 mounted to /home/student/internetfiles
    • partition 4 mounted to /home/student/schooldocs
    • partition 5 mounted to /home/student/labreports
  6. Use the mount command to verify that your partitions are all properly mounted
  7. Use the df command to verify the amount of free space on each partition
  8. Create or download some files into the various partitions. Note: You can use the Links or Lynx web browser to find and download some files.
  9. Unmount one or more of the partitions and verify that the files you created have "disappeared". Remount the partition to a different mount point and verify the files are back.
  10. Edit the /etc/fstab file so that your partitions are automatically mounted when the system reboots. Reboot the system and verifyu the partitions mounted correctly.
  11. Use the lsmod command to view kernel modules which are loaded. Try to determine what piece of hardware one or more of the listed modules is for.
  12. Don't forget to shut down your VM properly!

Optional Extra Credit Lab

  1. Install Ubuntu Linux Server Edition to a physical computer (not a VM)
  2. Experiment with viewing data about system hardware and driers using the following utilities
    • cat /proc/interrupts
    • cat /proc/ioports
    • cat /proc/dma
    • lspci
    • lsmod
    • lsusb
    • dmesg
  3. Try adding additional hardware to the system either by adding USB devices or extra PCI or PCI Express Cards and re-check your system with the above utilities. Can you find the new hardware, what modules it's using and how it can be accessed and used by the system?

Chapter 4

  1. Use the ls command to list files in a directory
    • Use the -a and -l options to get a long file listing and one that includes hidden files
    • Display the file types as part of the listing
  2. Use the cp command to try copying files and entire directories from one location to another
  3. Use the mv command to try moving files and entire directories from one location to another
  4. Use the rm command to try deleting files and entire directories
  5. Use the touch command to modify file access times
  6. Use the tar utility to backup a folder and all the files it contains into a single gzipped tar file
    • Extract your gzipped tar file to some other location on your drive
  7. Use the ln utility to create hard and soft links to files in other places on your system
  8. Use the mkdir and rmdir commands to create and remove directories on your system
  9. Use the chown command to change the owner AND group of a file and of a directory plus all the files it contains (recursively)
  10. Use the chgrp command to change just the group of a file
  11. Use the chmod command to change the permissions on a file or directory using both octal and symbolic modes
  12. Use the locate, find, whereis, which and type commands to try finding files on your system

Chapter 5

  1. Identify and explore the GRUB configuration file on your system
  2. Use the dmesg utility to display the kernel ring buffer on your system
  3. Use the init command to switch between text-mod and GUI interfaces on a Fedora system
    1. Use the runlevel command to display the current runlevel and verify that it is changing
  4. Explore the inittab file (and it's Upstart replacement used in Ubuntu)
  5. View the SysV startup scripts installed on your system and check which ones are setup to start and stop at each of the runlevels
  6. Use the chkconfig command to list services running at each runlevel on your system
  7. Try shutting down and restarting your system using the shutdown command in combination with a shutdown timer
  8. Use Vi to create and edit a file, including:
    • Yanking and pasting lines and groups of lines
    • Deleting groups of lines at a time
    • Searching and replacing text
    • Saving and quitting

Chapter 6

  1. Use the Xorg -configure command to create a xorg.conf file and review the sections found in that file
  2. Attempt to change the X resolution through the xorg.conf file
    • If you are unable to change the resolution in the xorg.conf file try changing it through a GUI monitor resolution tool
  3. Try out several accessibility options in X, for example:
    • Sticky Keys
    • Slow Keys
    • Bounce Keys
    • Mouse Keys / Mouse Navigation Emulation
    • Dwell Click / Simulated Mouse Clicks
  4. Check the locales installed on your system with the locale -a command
  5. Change the current locale (including switching the character encoding method if you have a locale with a different encoding method installed) and timezone of your system
    1. Create a new text file while in a different character encoding mode
    2. Change your locale and timezone back to their original settings
    3. Use the iconv program to convert the text file you created to your default character encoding method

Chapter 7

  1. Users and Groups
    1. Create new users on the system
    2. Create new groups on the system
    3. Explore the /etc/passwd, /etc/group and /etc/shadow files
    4. Change the password of the current user
    5. Change the password of another user as Root
    6. Use the chown and chgrp commands to change the owner and group associated with files and folders
    7. Remove users from the system
  2. Explore the system logging settings in /etc/syslog.conf and /etc/logrotate.conf
  3. Review system logfiles
  4. Manually set the system date and time
  5. Configure NTP to automatically update the system date and time
  6. Setup a system and user cron job to run a scheduled task

Chapter 8

  1. Check network interface configurations with ifconfig
  2. Set the system hostname (temporairly with hostname and permanently with /etc/hostname)
  3. Resovle DNS names with nslookup, host and dig
  4. Explore system name resolution settings in /etc/hosts, /etc/resolv.conf and /etc/nsswitch.conf
  5. Configure a network interface in both Ubuntu and Fedora using graphical and text only modes for DHCP and for a static address
  6. Stop and start a network interface to apply settings
  7. Explore the system routing table
  8. Enable IP Forwarding
  9. Test system connectivity
    1. With the ping command
    2. With the traceroute command
    3. With the netstat command
    4. With the telnet or ftp utilities
  10. Examine network traffic with the tcpdump utility

Chapter 9

  1. Try viewing some of the predefined environment variables
  2. Try setting an environment variable of your own and then viewing it
  3. Create an alias for a command and they try using it
  4. Explore the global and per-user shell configuration files
  5. Write a basic shell script, make it executable and test it out
  6. Try writing a shell script using conditionals, loops or functions and then test it out
  7. Setup one of the email server programs such as Postfix on your system for local mail delivery
  8. Try sending messages between users of your system using the command line as well as a graphical client
  9. Create an e-mail alias which directs mail to one or more users on your system and test it out
  10. Install the MySQL server on your system and work through all the MySQL commands from p.456 to p.465

Chapter 10

  1. Install the xinetd super server and explore the configuration files
  2. Use the netstat and lsof commands to check open ports on your system
  3. Install the nmap scanner and try running a scan on your own system (127.0.0.1)
  4. Setup the sudo program to allow limited access to run commands as root for various users on your system and try this out
  5. Search your system for all SUID/SGID files
  6. Install the SSH server on your systems and try SSHing from one system to another
  7. Try copying files between systems with SCP
  8. Try to setup SSH to use authorized_keys instead of passwords for one of your users
  9. Install GPG and create a key for your user
  10. Try encrypting and decrypting a text file using GPG

Webmin and Apache

  1. Install the links and lynx text-mode web browsers on your Ubuntu Server System
    1. Install these packages on your Ubuntu Server system
      • links lynx
  2. Install Webmin on your Ubuntu Server System
    1. Download the Webmin DEB package from http://www.webmin.com
    2. Install the following packages on your Ubuntu Server (command line only) system through one of the APT utilities:
      • perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl libmd5-perl apt-show-versions libapt-pkg-perl
    3. Install the Webmin DEB package you downloaded with the dpkg utility
    4. Check the IP address of your system
    5. Using a web browser on your HOST (i.e. Windows) system visit https://your-ubuntu-server-ip-address:10000
    6. Login to the Webmin interface with the username "root" and your system root password
  3. Install Apache 2, PHP5 and MySQL on your Ubuntu Server System
    1. Install these packages on your Ubuntu Server system
      • apache2 mysql-server php5 php5-mysql
    2. Login to the Webmin interface and "Refresh Modules" to get the Apache Webserver and MySQL server to show up in Webmin
  4. Install a WordPress blog or a MyBB bulletin board
    1. Download and install (following instructions included in the download) the WordPress or MyBB software on your webserver. Note that this will involve creating a MySQL database.
    2. Make sure that you can access and use your web application through a browser on your host system accessing http://your-ubuntu-server-ip-address