Franske ITC-2480 Lab 1: Difference between revisions
BenFranske (talk | contribs) |
BenFranske (talk | contribs) |
||
Line 34: | Line 34: | ||
# 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. | # 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. | ||
# You do not want to scan any other CDs or DVDs at this time. | # You do not want to scan any other CDs or DVDs at this time. | ||
# 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 " | # 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 "cosmos.cites.illinois.edu" with no http proxy. | ||
# Choose whether you want to participate in the package usage survey, for our purposes either choice is just fine. | # Choose whether you want to participate in the package usage survey, for our purposes either choice is just fine. | ||
# 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. | # 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. |
Revision as of 18:17, 10 January 2018
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
- Connect to the ITCnet either by directly plugging into an ITCnet port in one of the ITC labs or by connecting to the VPN
- 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.
- Connect to the ITC VMware vSphere Web Client
- Click the "Hosts and Clusters" tab on the left side of the screen under "Inventory Trees"
- Expand the ITC -> Cluster One -> "2480" resource pool by clicking the small black triangles to the left of each part of the tree.
- 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.
- Right click on your virtual machine and select "Edit Settings..."
- When the settings panel loads click the small grey triangle to the left of "CD/DVD drive 1"
- Ensure the CD/DVD drive is set to "Datastore ISO File"
- Ensure the "Connect At Power On" box is checked
- Click the "Browse..." button to the right of the "CD/DVD Media" box.
- Click the "SAN0 Shared" datastore and then double click on the "ISOs" folder.
- Select the "debain-9.3.0-amd64-netinst.iso" file and click the OK button.
- Click the OK button again to close the settings dialog box.
- Your VM is now setup and ready to be installed.
Debian Linux Installation
- Right-click on your virtual machine and select "Power On"
- Click OK on the "Power On Recommendations" dialog box
- 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.
- 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.
- 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.
- Select "English" as the language, "United States" as your location, and "American English" as the keymap.
- Set ens192 as your primary network interface.
- Set a hostname for the system the same as your assigned machine name (e.g. 2480-BF)
- Set the domain name to "itc2480.campus.ihitc.net"
- 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)
- 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
- Select your timezone
- 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.
- You do not want to scan any other CDs or DVDs at this time.
- 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 "cosmos.cites.illinois.edu" with no http proxy.
- Choose whether you want to participate in the package usage survey, for our purposes either choice is just fine.
- 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.
- Choose that yes you want to install GRUB to the master boot record on the "/dev/sda" device.
- 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
- Login through the local console with your root account and password (username root, password as set during the installation)
- 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.
- 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.
- Reboot your system using the "shutdown -r now" command to apply the changes
- Log in as your standard user account
- Use the "sudo ip address show" command to check the IP address of your system, you will need to enter in your password again when you run this command. The IP address should be something like 172.17.50.xxx and be an "inet" address on the enp0s3 adapter.
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.
- Assuming you are running Windows, install the PuTTY software on your home PC from this website.
- 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.
- Click Yes to save the host key on your system
- Enter the standard username and password for your Linux system to connect.
- You should receive a prompt just like the one you had on the local vmWare console.
- 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.
- Install the FileZilla client software on your home PC from this website
- 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.
- 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.
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.
- Connect in to your system using the remote SSH console method explained above.
- 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.
- 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.
- Right click on your virtual machine and select "Edit Settings..."
- When the settings panel loads click the small grey triangle to the left of "CD/DVD drive 1"
- Ensure the CD/DVD drive is set to "Datastore ISO File"
- Ensure the "Connect At Power On" box is NOT checked
- You can now close any of the vmWare browser windows you may still have open.