GNU/Linux: An Essential Guide for Students Undertaking BLOSSOM

Similar documents
Linux Capabilities & Set-UID Vulnerability

Linux Systems Administration Getting Started with Linux

Chapter Two. Lesson A. Objectives. Exploring the UNIX File System and File Security. Understanding Files and Directories

Welcome to getting started with Ubuntu Server. This System Administrator Manual. guide to be simple to follow, with step by step instructions

INTRODUCTION TO LINUX

Linux Kung Fu. Stephen James UBNetDef, Spring 2017

Introduction. What is Linux? What is the difference between a client and a server?

Manage Directories and Files in Linux. Objectives. Understand the Filesystem Hierarchy Standard (FHS)

Overview LEARN. History of Linux Linux Architecture Linux File System Linux Access Linux Commands File Permission Editors Conclusion and Questions

LAB #7 Linux Tutorial

Linux Essentials Objectives Topics:

Essential Unix and Linux! Perl for Bioinformatics, ! F. Pineda

Introduction to Linux. Woo-Yeong Jeong Computer Systems Laboratory Sungkyunkwan University

Perl and R Scripting for Biologists

Lab Working with Linux Command Line

Hands-on Keyboard: Cyber Experiments for Strategists and Policy Makers

Filesystem Hierarchy and Permissions

System Administration for Beginners

Introduction to Linux

Linux Kung Fu. Ross Ventresca UBNetDef, Fall 2017

Getting Started with Linux

Linux Kung-Fu. James Droste UBNetDef Fall 2016

GNU/Linux 101. Casey McLaughlin. Research Computing Center Spring Workshop Series 2018

Introduction to Linux

Filesystem Hierarchy and Permissions

CS/CIS 249 SP18 - Intro to Information Security

Filesystem Hierarchy Operating systems I800 Edmund Laugasson

EECS Software Tools. Lab 2 Tutorial: Introduction to UNIX/Linux. Tilemachos Pechlivanoglou

*nix Crash Course. Presented by: Virginia Tech Linux / Unix Users Group VTLUUG

Caja File Manager. Desktop User Guide

Introduction of Linux

Stop all processes and then reboot - same as above startx. Log in as superuser from current login exit

Linux Essentials. Programming and Data Structures Lab M Tech CS First Year, First Semester

Lab 1: Introduction to Linux Networking

File System Hierarchy Standard (FHS)

Working with Ubuntu Linux. Track 2 Workshop June 2010 Pago Pago, American Samoa

h/w m/c Kernel shell Application s/w user

commandname flags arguments

Linux Essentials. Smith, Roderick W. Table of Contents ISBN-13: Introduction xvii. Chapter 1 Selecting an Operating System 1

Unix System Architecture, File System, and Shell Commands

Introduction to Linux

CISC 220 fall 2011, set 1: Linux basics

CSE 303 Lecture 2. Introduction to bash shell. read Linux Pocket Guide pp , 58-59, 60, 65-70, 71-72, 77-80

Introduction to Linux (Part I) BUPT/QMUL 2018/03/14

Session 1: Accessing MUGrid and Command Line Basics

Linux Command Line Primer. By: Scott Marshall

Exam LFCS/Course 55187B Linux System Administration

Embedded Linux Systems. Bin Li Assistant Professor Dept. of Electrical, Computer and Biomedical Engineering University of Rhode Island

CS197U: A Hands on Introduction to Unix

The landscape. File hierarchy overview. A tree structure of directories The directory tree is standardized. But varies slightly among distributions

UNIT 9 Introduction to Linux and Ubuntu

ECE 471 Embedded Systems Lecture 10

D, E I, J, K. Generalized Regular Expression Parser (GREP), 110 Generic 105 key (Intl) PC, 29 git command, 242

CHAPTER 1 INTRODUCTION TO THE INTERNET LAB

Introduction to Linux

Blossom Hands-on exercises for computer forensics and security. Buffer Overflow

At course completion. Overview. Audience profile. Course Outline. : 55187B: Linux System Administration. Course Outline :: 55187B::

CS370 Operating Systems

Operating Systems Linux 1-2 Measurements Background material

ITEC451 Network Design & Analysis Laboratory Guide: Appendix

"Charting the Course... MOC B: Linux System Administration. Course Summary

Course 55187B Linux System Administration

CS Fundamentals of Programming II Fall Very Basic UNIX

CS197U: A Hands on Introduction to Unix

Virtual Machine. Linux flavor : Debian. Everything (except slides) preinstalled for you.

CSE 390a Lecture 2. Exploring Shell Commands, Streams, Redirection, and Processes

Installing Altiris Agent on Ubuntu

Modern C++ for Computer Vision and Image Processing. Igor Bogoslavskyi and Cyrill Stachniss

Lecture 3: The UNIX Style

Getting your department account

Commands are in black

Linux & Shell Programming 2014

commands exercises Linux System Administration and IP Services AfNOG 2015 Linux Commands # Notes

LIS Linux/Unix Command Line Goodness

History. Terminology. Opening a Terminal. Introduction to the Unix command line GNOME

1 Installation (briefly)

Chapter-3. Introduction to Unix: Fundamental Commands

Introduction to Linux. Roman Cheplyaka

Linux Class 2. Debian file system, superuser, editing text files, executing comands in the shell, configuring, installing and uninstalling packages.

Computer Systems and Architecture

National University of Computer and Emerging Sciences Operating System Lab - 02 Lab Manual

Installation of the OS

Introduction to Linux

Introduction to Linux

Linux Operating System Environment Computadors Grau en Ciència i Enginyeria de Dades Q2

Introduction. Let s start with the first set of slides

CS197U: A Hands on Introduction to Unix

INF322 Operating Systems

Linux crash lecture by Andrey Lukyanenko

The UNIX Operating System. HORT Lecture 2 Instructor: Kranthi Varala

CSE 390a Lecture 3. bash shell continued: processes; multi-user systems; remote login; editors

Introduction to Unix The Windows User perspective. Wes Frisby Kyle Horne Todd Johansen

Introduction to Unix: Fundamental Commands

Lab #9: Basic Linux Networking

Preview. COSC350 System Software, Fall

IOL INTACT Installation Guide

Introduction to Linux. Fundamentals of Computer Science

Introduction: What is Unix?

Operating Systems Lab 1 (Users, Groups, and Security)

CS 215 Fundamentals of Programming II Spring 2019 Very Basic UNIX

Transcription:

Copyright: The development of this document is funded by Higher Education of Academy. Permission is granted to copy, distribute and /or modify this document under a license compliant with the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/. GNU/Linux: An Essential Guide for Students Undertaking BLOSSOM BLOSSOM Manchester Metropolitan University (Funded by Higher Education Academy) blossomlhan@gmail.com

1. Learning Objectives This lab aims to understand basic operations of Linux system 2. Preparation 1) Under Linux environment 2) Some documents that you may need to refer to: 'Virtual-Machine-Guide.pdf' 3. Tasks Setup & Installation: 1: Start a single virtual machine as you have done with previous exercises (see Virtual Machine Guide) # kvm -cdrom /var/tmp/debian-live-6.0.4-i386-gnome-desktop.iso -m 512 -net nic,macaddr=52:54:00:12:34:57 -net vde -name node-one 2: Use the following set of commands to download everything that is required for the lab, as well as any dependencies required: # apt-get update # apt-get install apache2 Task 1 (LINUX/UNIX File Structure and Commands): 1.1: Whilst LINUX has not been as successful as MAC OS and Microsoft Windows, it has excelled in the server market. The majority, if not all of the services you rely on from day to day, such as email and websites rely on an enormous number of LINUX servers. It is essential for anyone undertaking a computer science based course to have a grasp of LINUX. This document merely provides a basis for the essential commands for you to complete the lab exercises. In *NIX systems (LINUX and UNIX), directories are placed in a hierarchical structure, at the top is /, everything else is placed underneath, regardless of physical location. This may be a difficult concept to grasp if you've come from a Windows background. Physical disks may be mounted underneath this umbrella in any location, to the end user this is completely transparent. On nearly all LINUX based systems, you can expect to find the following directories under /:

Directory bin dev home lib64 and/or lib media opt root sbin sys usr boot etc var mnt proc Typical Contents Program binaries Device files, each physical device is represented by a file User's files Shared libraries 64 and 32 bit respectively Typical location where removable media is mounted Program extras that are not part of the default installation The administrative user's personal files Administrative programs A virtual file system for device settings User applications and other resources required to run them Files needed to boot the operating system Configuration files of programs Variable system data A popular place to mount hard disks A virtual directory that contains information about the kernel So for example, the location of the file that controls the name of the computer is /etc/hostname 1.2 Making files and directories mkdir ~/blossom create a directory under your home directory nano ~/blossom/foobar.txt create a file under blossom directory mkdir ~/blossom/desktop create a directory under the blossom directory 1.3 Copying files from one location to another in Linux can be done very easily with the cp command: cp /home/blossom/foobar.txt /home/blossom/desktop/

Copies foobar.txt from the user blossom's home directory to their Desktop. cp /home/blossom/foorbar.txt./foobarcopy.txt Copies foobar.txt into the same directory, calling the copy foobarcopy.txt cp - r /home/blossom/somedirectory /home/blossom/desktop Copies the entire folder somedirectory to the user's desktop. Try and copy the file /etc/resolv.conf to your home directory. 1.4: Moving files is as simple as copying, if not simpler; the mv program does not require the -r flag when moving directories: mv /home/blossom/foobar.txt /home/blossom/desktop/ Moves foobar.txt from the user blossom's home directory to their Desktop. mv /home/blossom/foorbar.txt./foobarcopy.txt Renames foobar.txt, foobarcopy.txt mv /home/blossom/somedirectory /home/blossom/desktop Moves somedirectory into the Desktop When using a terminal or bash script, it is possible to use 'wildcards' (*) for certain functions, for example: mv /home/blossom/*.txt /home/blossom/desktop/ Moves all.txt from the user blossom's home directory to their Desktop. Try and move the resolv.conf copy that you made earlier from your home directory to your desktop. Another extremely useful command is rm, which will simply remove a file: rm /home/blossom/foobar.txt Removes foobar.txt from the user blossom's home directory Try and remove the file resolv.conf from your desktop. 1.5: There are many text editors available for use in Linux, but the two main recommendations would be either gedit or nano: nano

nano is a command line based text editor. To edit or create a file simply type in a terminal nano followed by the name of the file: nano /foo/bar.config You can save and exit the program by pressing CTRL+X gedit gedit has an extremely intuitive interface, it is invoked the same way as nano. Task 2 Super User, Programs & Daemons 2.1: There is an obvious need to restrict normal users from editing or viewing certain files, such as system configuration files. If you need to become an administrator, you have two options, su and sudo. If you wish to temporarily elevate your privileges, you can prefix your commands with sudo: sudo rm - r /* If you want to become the administrator, then you should use the command su. When asked for the password, simply enter the root users password. All subsequent commands will be executed as root. To exit, type exit. 2.2: To kill a program that you know the name of, use the 'killall' command. For example, to kill a program that uses java, execute: # killall java Use of this command is generally frowned upon, and should be avoided if possible. Kill is the preferred command. Use 'top' to look up the PID (Process ID) of the program you want to kill. Then use: # kill -9 XXXX 2.3: Services, such as apache (a popular web server), can be controlled via two methods: # service apache2 restart # /etc/init.d/apache2 restart Available options are usually: start, stop, restart and reload (which reloads the configuration files in-place).

Task 3 Linux Networking Principles 3.1: Linux is renowned for its excellent, reliable and modular networking facilities. All physical and virtual network interfaces have a name. Ethernet ports are usually named ethx, where X is a number. Wireless devices are usually named wlanx, athx or wifix. lo is the 'loopback' interface, any traffic directed to it is then redirected to the host. You can look up a list of interfaces by calling the ifconfig command: # ifconfig You can view routes using the netstat command: # netstat -r 3.2: You can find the configuration for each interface (on debian systems) in /etc/networking/interfaces. The DNS server setting can be found in /etc/resolv.conf The hosts file, which controls which names are associated with which IP addresses can be found at /etc/hosts Alter /etc/resolv.conf to use 208.67.222.222 and 208.67.220.220, and then restart the networking interface.