Franske ITC-2480 Lab 1: Difference between revisions

From ITCwiki
Jump to navigation Jump to search
No edit summary
Line 65: Line 65:
# You should see some connection text scroll on the top of the screen and some files on the right side of the screen now such as ''.bashrc'' and ''.profile'' The right side of the screen is the drive on your Linux system and the left side of the screen is the drive on your home system. Files and folders can be dragged between the two sides to transfer them back and forth.
# You should see some connection text scroll on the top of the screen and some files on the right side of the screen now such as ''.bashrc'' and ''.profile'' The right side of the screen is the drive on your Linux system and the left side of the screen is the drive on your home system. Files and folders can be dragged between the two sides to transfer them back and forth.
# Close the FileZilla software to disconnect.
# Close the FileZilla software to disconnect.
=Install VM Tools=
Because your Debian Linux server is running as a virtual machine on a vmWare host system in order to achieve the best performance and driver integration we should install the vmWare Tools software package in your virtual machine.
# Connect in to your system using the remote SSH console method explained above.
# Run the '''sudo apt install open-vm-tools''' command to install the vmWare Tools. You will be prompted about several additional software packages required to be installed, type ''y'' and press enter to install the software.


=Safely Shutdown=
=Safely Shutdown=

Revision as of 18:38, 16 December 2020

Introduction

In this lab you will install the latest version of Debian Linux in a virtual machine, learn how to login and check the IP address of the system, and learn to remotely access the system with SSH and SFTP.

VM Setup

  1. Connect to the ITCnet either by directly plugging into an ITCnet port in one of the ITC labs or by connecting to the VPN.
  2. Make sure you have the required VMware remote console software installed on your computer and you're able to log in to the VMware vSphere Web Client. See these instructions for details on accessing the ITC VMware infrastructure and getting the required software installed on your computer.
  3. Connect to the ITC VMware vSphere Web Client
  4. Click the "Hosts and Clusters" tab on the left side of the screen under "Inventory Trees"
  5. Expand the ITC -> Cluster One -> "2480" resource pool by clicking the small black triangles to the left of each part of the tree.
  6. In the center panel of your screen find your virtual machine (which your instructor has given you an ID letter for) and click on it, for example, mine is "2480-BF". If you see one do not use the second VM (like "2480-BF-II") yet.
  7. Right click on your virtual machine and select "Edit Settings..."
  8. When the settings panel loads click the small grey triangle to the left of "CD/DVD drive 1"
    1. Ensure the CD/DVD drive is set to "Datastore ISO File"
    2. Ensure the "Connect At Power On" box is checked
    3. Click the OK button again to close the settings dialog box.
  9. Your VM is now setup and ready to be installed.

Debian Linux Installation

  1. Right-click on your virtual machine and select "Power On"
  2. Click OK on the "Power On Recommendations" dialog box
  3. Click on the miniature screenshot of your VM in the upper left corner of the VMware display to open a local console in a new window.
  4. Once the CD boots to the "Installer Boot Menu" choose "Install" and not "Graphical Install" which does not fully work correctly in the VMware web console. If you make an incorrect choice you can reboot your virtual machine (power off and on) before installing to get back to the menu.
  5. In the installer you will use the space bar to select and unselect "checkboxes", the tab key to move between fields and buttons, and the enter key to continue.
  6. Select English as the language, United States as your location, and American English as the keymap.
  7. Set ens192 as your primary network interface.
  8. Set a hostname for the system the same as your assigned machine name (e.g. 2480-BF)
  9. Set the domain name to itc2480.campus.ihitc.net
  10. Set the root password to something you will NOT FORGET, this is the administrator account, cisco might be a good choice for our purposes though that would not be secure for a system directly accessible from the Internet (we are protected by a firewall which you are bypassing via the VPN connection)
  11. Create a new user account by entering your name. The system will automatically use your first name (all lowercase) as the username and then you should set the password to another password you will not forget
  12. Select your timezone
  13. Choose "Guided - Use entire disk" as the partitioning method and select the sda drive and "All files in one partition" as the partitioning scheme, "Finish partitioning and write the changes to the disk", and then finally confirm you want to write the changes.
  14. You do not want to scan any other CDs or DVDs at this time.
  15. You want to select a mirror located close to you with good speed. Because your VM is actually running from the campus and is connected to the campus Internet connection a good option is "debian.uchicago.edu" with no http proxy.
  16. Choose whether you want to participate in the package usage survey, for our purposes either choice is just fine.
  17. On the software selection screen UNSELECT "Debian desktop environment" and "Print server" and make sure that "SSH server" and "Standard system utilities" are the only two selected options.
    • NOTE: To select and unselect options move your cursor over the option and press the space bar.
  18. Choose that yes you want to install GRUB to the master boot record on the /dev/sda device.
  19. When the installation is complete you can select continue to "eject" the virtual CD and reboot into the new install

Installing sudo and checking your IP address

  1. Login through the local console with your root account and password (username root, password as set during the installation)
    • NOTE: When entering a password on the command line of a Linux system it is normal that nothing should appear and the cursor will not move when you are typing. This prevents someone who is able to see your computer screen from seeing what your password is or even how long it is. Just type your password and trust that the system is receiving it, press enter to submit your password.
  2. For security purposes it is usually the case that you do not want to log in as the root user. Instead, best practice is to log in as a standard user and then execute specific commands that require root access with administrative privileges through the sudo program. The sudo program is not installed by default so after you have logged in to the root account enter apt update and press enter which will update the list of software available for installation and then apt install sudo and press enter to install the sudo software.
  3. We now need to add our standard user account to the group which is allowed to have administrative access to do this enter the command adduser <username> sudo and press enter, replacing <username> with the name of your standard user account (set during the setup process, probably your first name in lowercase). We'll learn more about these commands later in the course.
  4. Reboot your system using the shutdown -r now command to apply the changes
  5. Log in as your standard user account
  6. Use the ip address show command to check the IP address of your system. The IP address should be something like 172.17.50.xxx and be an inet address on the ens192 adapter.
  7. Try running the same command as the administrator by typing sudo ip address show, you will need to enter in your password again when you run this command.
  8. To log out of the console type exit and press enter.

Logging in to a remote terminal

A faster way to interact with your system is not through the VMWare local console but through a remote SSH session. For our purposes you will always need to connect to the ITCnet VPN before doing this so that you have access to the 172.17.50.0 network.

  1. Assuming you are running Windows, install the PuTTY software on your home PC from this website.
  2. Run the PuTTY software on your computer and enter in the IP address of your VM in the "Host Name" box and click the "Open" button.
  3. Click Yes to save the host key on your system
  4. Enter the standard username and password for your Linux system to connect.
  5. You should receive a prompt just like the one you had on the local VMWare console.
  6. Type exit to close the connection while leaving your VM running.

Remote File Transfer

The easiest way to transfer files to and from your VM is with SFTP software. For our purposes you will always need to connect to the ITCnet VPN before doing this so that you have access to the 172.17.50.0 network.

  1. Install the FileZilla client software on your home PC from this website
  2. Run FileZilla and use the Quick Connect bar at the top of the screen to access your system. Enter the IP address of your Linux system in the "Host:" box, your standard username and password in the appropriate boxes and 22 in the "Port:" box and click the "Quickconnect" button.
  3. You should see some connection text scroll on the top of the screen and some files on the right side of the screen now such as .bashrc and .profile The right side of the screen is the drive on your Linux system and the left side of the screen is the drive on your home system. Files and folders can be dragged between the two sides to transfer them back and forth.
  4. Close the FileZilla software to disconnect.

Install VM Tools

Because your Debian Linux server is running as a virtual machine on a vmWare host system in order to achieve the best performance and driver integration we should install the vmWare Tools software package in your virtual machine.

  1. Connect in to your system using the remote SSH console method explained above.
  2. Run the sudo apt install open-vm-tools command to install the vmWare Tools. You will be prompted about several additional software packages required to be installed, type y and press enter to install the software.


Safely Shutdown

We will normally leave our VM running but it is important that you know how to shutdown a Linux system correctly so this time we'll turn it off.

  1. Connect in to your system using the remote SSH console method explained above.
  2. Run the sudo shutdown -h now command to safely shutdown the system. You should soon get a message that PuTTY has lost it's connection. Click OK and then you can close the PuTTY window.
  3. Now would be a good time to make sure that you have disconnected the virtual CD so that your system will not try to boot into the installer again.
    1. Right click on your virtual machine and select "Edit Settings..."
    2. When the settings panel loads click the small grey triangle to the left of "CD/DVD drive 1"
      1. Ensure the CD/DVD drive is set to "Datastore ISO File"
      2. Ensure the "Connect At Power On" box is NOT checked
  4. You can now close any of the VMWare browser windows you may still have open.