Optimisacion del ancho de banda (Introduction to Linux)

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

Embedded System Design

Linux Essentials Objectives Topics:

Accurate study guides, High passing rate! IT TEST BOOK QUESTION & ANSWER. Ittestbook provides update free of charge in one year!

RH133. Red Hat Linux System Administration

Chapter 6. Linux File System

Actual4Test. Actual4test - actual test exam dumps-pass for IT exams

RedHat. Rh202. Redhat Certified Technician on Redhat Enterprise Linux 4 (Labs)

Exam Questions RH133

RH-202. RedHat. Redhat Certified Technician on Redhat Enterprise Linux 4 (Labs)

SA2 v6 Linux System Administration II Net Configuration, Software, Troubleshooting

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

EX200.redhat

Commands are in black

EX200.Lead2pass.Exam.24q. Exam Code: EX200. Exam Name: Red Hat Certified System Administrator RHCSA. Version 14.0

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

Linux Kung Fu. Stephen James UBNetDef, Spring 2017

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

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

Seltestengine EX200 24q

EX200.exam.35q. Number: EX200 Passing Score: 800 Time Limit: 120 min. EX200. Red Hat Certified System Administrator RHCSA

Course 55187B Linux System Administration

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

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

Red Hat.Actualtests.EX200.v by.Dixon.22q. Exam Code: EX200. Exam Name: Red Hat Certified System Administrator (RHCSA) Exam

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

Linux+ Guide to Linux Certification, Third Edition. Chapter 2 Linux Installation and Usage

Disks, Filesystems 1

INTRODUCTION TO LINUX

Linux Kung-Fu. James Droste UBNetDef Fall 2016

GNU/Linux: An Essential Guide for Students Undertaking BLOSSOM

Linux Files and the File System

Project #3: Implementing NIS

Filesystem Hierarchy Operating systems I800 Edmund Laugasson

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

Unix File System. Class Meeting 2. * Notes adapted by Joy Mukherjee from previous work by other members of the CS faculty at Virginia Tech

Some Ubuntu Practice...

Vendor: RedHat. Exam Code: EX200. Exam Name: Red Hat Certified System Administrator - RHCSA. Version: Demo

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

Linux Systems Administration Getting Started with Linux

How to Use This Lab Manual

Filesystem Hierarchy and Permissions

Redhat Basic. Need. Your. What. Operation G U I D E. Technical Hand Note template version

example.com index.html # vim /etc/httpd/conf/httpd.conf NameVirtualHost :80 <VirtualHost :80> DocumentRoot /var/www/html/

Disks, Filesystems, Booting Todd Kelley CST8177 Todd Kelley 1

Exam Questions RH302

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

Unix Filesystem. January 26 th, 2004 Class Meeting 2

File System Hierarchy Standard (FHS)

Filesystem Hierarchy and Permissions

Disks, Filesystems Todd Kelley CST8177 Todd Kelley 1

Installing caos with Cinch on Floppy Disk

Installation of Fedora 12 with CD

EX200 EX200. Red Hat Certified System Administrator RHCSA

Post Ubuntu Install Exercises

CST8207: GNU/Linux Operating Systems I Lab Nine Disks, Partitions, and File Systems Part 2. Disks, Partitions, and File Systems - Part 2 of 2

CompTIA Linux+ Guide to Linux Certification Fourth Edition. Chapter 2 Linux Installation and Usage

CompTIA Linux Course Overview. Prerequisites/Audience. Course Outline. Exam Code: XK0-002 Course Length: 5 Days

This is Worksheet and Assignment 12. Disks, Partitions, and File Systems

02. At the command prompt, type usermod -l bozo bozo2 and press Enter to change the login name for the user bozo2 back to bozo. => steps 03.

PiCloud. Building owncloud on a Raspberry PI

CS197U: A Hands on Introduction to Unix

Topics. Installation Basics of Using GNU/ Linux Administration Tools

Getting Started with Linux

The table below lists the domains measured by this examination and the extent to which they are represented in the examination.

Ubuntu Practice and Configuration Post Installation Exercises interlab at AIT Bangkok, Thailand

CL030 is a csage Certification Preparatory Course!

Exam Linux-Praxis - 1 ( From )

Chapter 02 Linux Installation and Usage

Basic UNIX system administration

CST8207: GNU/Linux Operating Systems I Lab Seven Linux User and Group Management. Linux User and Group Management

Lab 2A> ADDING USERS in Linux

Perl and R Scripting for Biologists

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

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

SysadminSG RHCSA Study Guide

User accounts and authorization

Chapter 5: User Management. Chapter 5 User Management

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

RG-MACC_2.0 Installation Manual

Lab on User administration

1Z Oracle Linux 5 and 6 System Administration Exam Summary Syllabus Questions

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

SANS Institute - Operations Essentials. Operating System Installation Guidelines. Windows XP Professional Installation. Creating Boot Disks

Lecture 2: The file system

ITDUMPS QUESTION & ANSWER. Accurate study guides, High passing rate! IT dumps provides update free of charge in one year!

User Management. René Serral-Gracià Xavier Martorell-Bofill 1. May 26, Universitat Politècnica de Catalunya (UPC)

Please choose the best answer. More than one answer might be true, but choose the one that is best.

CST8207: GNU/Linux Operating Systems I Lab Seven Linux User and Group Management. Linux User and Group Management

Linux Software Management. Linux System Administration COMP2018 Summer 2017

1Z0-100 oracle.

CS/CIS 249 SP18 - Intro to Information Security

Linux System Administration, level 1. Lecture 4: Partitioning and Filesystems Part II: Tools & Methods

TestOut Linux Pro - English 4.0.x OBJECTIVE MAPPING: CompTIA Linux+ LX0-103

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

Defensie Exercises preparing for the exam.

INF322 Operating Systems

1Z Oracle Linux 6 Implementation Essentials Exam Summary Syllabus Questions

Installing caos with Cinch on CDROM

Transcription:

UNAN-Managua Optimisacion del ancho de banda (Introduction to Linux) Christian Benvenuti christian.benvenuti@libero.it Managua, Nicaragua, 27-28/8/09

Presentaciones

Introduction to Linux This is NOT: A workshop on Linux/Unix system/network administration A workshop on network security an advanced workshop on BMO. This is: A 2-day workshop dedicated to reviewing basic Linux/Unix concepts in order to be able to focus on BMO the next weeks (since we will work with Linux systems the all time).

Program Linux Distributions Installation process Documentation Users/Groups Filesystem/s Package management Automating tasks System services Run levels DNS Basics and config Basic host net cfg Kernel and Modules Log files

Program Linux Distributions Installation process Documentation Users/Groups Filesystem/s Package management Automating tasks System services Run levels DNS Basics and config Basic host net cfg Kernel and Modules Log files

Linux Distributions (See http://en.wikipedia.org/wiki/linux_distribution)

Linux Distributions Graphical interface/s Easiness of use Kernel version (vanilla + enhancements) Application types (security, Virtual Machines,...) Standard and/or Live Free and/or Commercial

Program Linux Distributions Installation process Documentation Users/Groups Filesystem/s Package management Automating tasks System services Run levels DNS Basics and config Basic host net cfg Kernel and Modules Log files

Installation process Media Source (CD, DVD, ISO image, NET) Disk Partitioning Window Manager/s and Applications User/App/System Configuration

Installation process (partitioning) Automatic vs Manual partitioning Factors to take into account: Dual / multiboot system HD / RAM upgrade OS vs DATA Encryption Volumes / RAID Special directories / partitions: /boot [SWAP] /var/log /home...

Installation process (Window Manager/s and Applications)... KDE (http://www.kde.org) GNOME (http://www.gnome.org) ENLIGHTMENT http://www.enlightenment.org (Do not confuse the Windows managers with the Window manager's themes)

Fedora Core 10 Installation

Please use the following configuration: Root password: una123 User name/password: una/una Hostname: PCXY where X/Y are Row/Column Partitions...

Programe Linux Distributions Installation process Documentation Users/Groups Filesystem/s Package management Automating tasks System services Run levels DNS Basics and config Basic host net cfg Kernel and Modules Log files

Documentation Command line documentation: man/info commands Basic kernel doc in directory <kernel_source>/documentation Homepage of the Linux distribution For example, Fedora doc available here: http://docs.fedoraproject.org/ The Linux Documentation Project: http://tldp.org Free online books (made legally available by the authors / publishers) and... Google

Programe Linux Distributions Installation process Documentation Users/Groups Filesystem/s Package management Automating tasks System services Run levels DNS Basics and config Basic host net cfg Kernel and Modules Log files

Users / Groups Creating/Deleting/Administering users How would you guess what the commands to add/del users/groups could be? Login Passwords How would you guess what the commands to change user login passwords could be? File permissions/ownerships suid commands

User / Groups useradd userdel usermod userpasswd (graphical interface) users (use w instead) Use the man command to get a description and the usage syntax.

Key files in /etc /etc/passwd /etc/shadow /etc/groups /etc/gshadow (we won't look at this)

Username X (pass) Syntax of /etc/passwd lines User ID (Primary) GroupID Comment Home Dir Shell Examples: root: x: 0: 0: root: /root: /bin/bash benve: x: 500: 500: CB: /home/benve: /bin/bash apache: x: 48: 48: Apache: /var/www: /sbin/nologin Username Encrypted password Syntax of /etc/shadow lines Last paswd change Minimum Maximum Warning Inactive Expire Examples: root: $6$x...: 14211: 0: 99999: 7: : : benve: $6$h...: 14212: 0: 99999: 7: : : apache:!!: 14211: 0: 99999: 7: : : Dove stanno i gruppi X Group name extra??? Group ID Group (pass) Syntax of /etc/group lines members Examples: root:x:0:root benve:x:500: apache:x:48:

Exercise 1 Using the command line: create the two new users user_test1 and user_test2 delete the user user_test2 Verify the configuration (how??? su )

Exercise 2 Using the command line: create the two new groups grp_test1 and grp_test2 add user user_test1 to group gpr_test1 Change user user_test1's password to 1234abcd Verify the configuration (how???)

Exercise 3 What is the Fedora GUI for managing users/groups? Using the Fedora GUI: create the new user user_test3 add user user_test3 to group grp_test2 Create the new group grp_test3 Add user user_test3 to group grp_test3 too Change user user_test3's password to abcd1234 Verify the configuration (how???)

File ownerships Each file/directory has: Owner user Owner group Changing ownerships Command chgrp Command chown

Exercise 4 Log in as user una. Create an empty file test_file.txt in your home directory Check its user/group owners Change them (using chmod) to root/root Change them (using chmod) to user_test3/grp_test1

Programe Linux Distributions Installation process Documentation Users/Groups Filesystem/s Package management Automating tasks System services Run levels DNS Basics and config Basic host net cfg Kernel and Modules Log files

Filesystems Default filesystem tree Filesystem types Special/Virtual filesystems Creating filesystems

Default filesystem tree / boot etc bin sbin home root mnt media usr var lib dev proc sys src bin sbin lib log modules sys (I have omitted a few directories for simplicity)

Filesystem types VFAT / NTFS (Windows compatibility) ext2 / ext3 / ext4 SWAP... Differences Native OS Simple or with support for Journaling Local or network(let's ignore this type for now)

Virtual Filesystems /proc /proc/sys /sys /dev...

Creating Filesystems /sbin/ mkfs mkfs.vfat mkfs.ntfs mkfs.ext2 mkfs.ext3 mkfs.ext4 mkswap... Example - Create an ext3 filesystem on the (already existent) partition /dev/sda5: mkfs.ext3 /dev/sda5

Creating Filesystems You do not create a filesystem on a directory You create it on: a partition, or an entire HD, or a Volume, or a file (that you will mount with the loop option)... etc

/sbin/ fsck Checking the integrity of a filesystem fsck.vfat fsck.ntfs fsck.ext2 fsck.ext3 fsck.ext4... Example Check the integrity of the ext3 filesystem on the (already existent) partition /dev/sda5: fsck.ext3 /dev/sda5

Mounting a Filesystem (mount command) Simplified syntax (see man for the complete syntax) mount [-t vfstype] [-o options] device dir Examples mount -t ext3 /dev/hda2 /home mount -t vfat /dev/hda3 /DATA_WIN

Exercise 5 Use the mount command to see what/where filesystems your system has mounted (do not get scared!) See what additional information the command df provides

Exercise 6 Create a new partition of 1GB If you do not know how to use the fdisk command, PLEASE ask! Create an ext3 filesystem on it Mount the new partition under /mnt/test (*) The mount command does not make changes permanent. How would you make the config (*) permanent?

Permissions User Group Others d/b/c/l r w x/s r w x r w x Examples /bin/ls /etc /usr/bin/passwd /dev/sda1 /dev/tty0 - rwx r-x r-x root root d rwx r-x r-x root root - rws r-x r-x root root b rw- rw- --- root disk c rw- -w- --- root root /sbin/mkfs.msdos l rwx rwx rwx root root mkfs.msdos -> mkdosfs

Changing Permissions (chmod command) You can add/remove/set permissions Simplified syntax (see man for the complete syntax) chmod [-R] [ugoa] [-+=] file/directory_name Examples chmod ugo=rx test.txt chmod go-w doc.txt chmod go+r foto.jpg chmod -R ugo+rwx /shared_dir/

Login as user una Exercise 7 Create a text file named arbol.txt Check its default permissions Would it make sense to add the X permission for the owner (ie user una)? And for the other users? Remove the R permission for Others. Verify it Remove the W permission for the people in the same group as user una. Verify it

Exercise 8 Log in as user una Create the text file lssl Check its permissions What result do you get if you type these commands? ls <TAB> <TAB>./ls <TAB> <TAB> Add the X permission to lssl for the user una Now what results do you get if you type the above two commands?

Hard VS Symbolic Links (ln command) Hard links cannot cross file system boundaries Simplified syntax (see man for the complete syntax) ln [-s] TARGET LINK_NAME Examples ln /data/foto/sol.jpg foto_sol.jpg ln -s /FOTOS/sol.jpg /home/una/desktop/foto_sol.jpg

Exercise 9 Login as root In the root's home directory create a hard link to /bin/ls named mio_ls Login as user una In the una's home directory create a hard link to /bin/ls named mio_ls In the una's home directory create a symbolic link to /bin/ls named mio_ls

Searching the Filesystem find vs locate Examples find /etc -name httpd* find /proc/sys -name ip_forward locate httpd.conf locate sch_htb

Exercise 10 Using the man command, find the syntax of the commands find and locate Now using the above commands determine: The location of the file xinetd.conf The location of the file ip_forward.c Answer the following questions (you can use the man command to get some help): Which one between the two is faster? Which one between the two is more reliable?

Exercise 11 Login as user una Create the file abcd_1234 in the directory /tmp Supposing you did not know where such file was, search it using find and locate. What results did you get? Now run the command updatedb Do find and locate return the same results now?

Programe Linux Distributions Installation process Documentation Users/Groups Filesystem/s Package management Automating tasks System services Run levels DNS Basics and config Basic host net cfg Kernel and Modules Log files

Package Management Distribution specific Different distributions provide different mechanisms for Installing applications Downloading updates Etc Tarball/CompressedTarball (.tar,.tar.gz,.tar.bz2,...) Can be used with any Linux distribution, but...

Package Management Since we are using Fedora Core 10 in the lab, we will look at: rpm yum / yumex (You can also use the apt/synaptic interface of Debian if like, but we won't look at this today. See package apt )... but also at tarball archives.

Package Management (rpm) Install a package (without taking care of dependencies) rpm -i <package_name> Check whether a package is installed rpm -qi <package_name> Get the list of files in a given package rpm -ql <package_name> Get the package a given file belongs to.... rpm -qf <file_name>

Exercise 12 Check whether the package iptables is installed on the system If it is installed, what version is it? When was it released? Determine, using the rpm command, what files belong to this package.

Exercise 13 Check whether the package yumex is installed on the system Download the package yumex (or get it from the Fedora Core 10 DVD you have used for the installation) Install it with the rpm command Determine, using the rpm command, what its configuration files are.

Exercise 14 Determine what package the file passwd belongs too. Determine what package the file /etc/resolv.conf belongs too. Determine what configuration files are used by the httpd web server.

Basic packages management (yum) Install a package (taking care of dependencies) yum install <package_name> Check dependencies for a package yum deplist <package_name> (ex yum deplist cacti) Search for packages matching a given string... yum search <string>

Exercise 15 Check whether the package yumex is already installed on the system Install it with the yum command if necessary Use yumex to install one package from the group Applications

Package Management (Repositories) The tools (like yum) that use the network to download applications/updates, connect to servers referred to as repositories. Depending on how you installed your system, by default your Fedora Core 10 system may be using only a couple of default repositories, but you can add others.

Exercise 16 Using the man command, determine the yum option that tells you what repositories yum is configure to use. Using the rpm command, determine what the configuration files of yum are, and find the piece of configuration that tells yum to use the repositories returned by the previous command. OPTIONAL EXERCISE: Add new repositories (for example http://rpm.livna.org/)

Package management (YumEx - ie, Yum Extender) yum install yumex

Package Management (PackageKit) Another GUI for managing packages See http://www.proyectofedora.org/wiki/index.php/packagekit It is ON by default on Fedora Core 10. EXERCISE: try to disable it.

Program Linux Distributions Installation process Documentation Users/Groups Filesystem/s Package management Automating tasks System services Run levels DNS Basics and config Basic host net cfg Kernel and Modules Log files

Kernel How/Where to download it Versioning scheme Source Code Configuration Compilation Installation Managing modules

Downloading (http://www.kernel.org)

Installation How many of you are (or used to be) programmers?

Installation Decompress it under /usr/src Configure it with one of the following commands (there are many more): make xconfig make menuconfig Compile the image make Compile the modules make modules Install the modules make modules_install Install the kernel image (ie, update bootloader) make install

Kernel (Modules) The package used to administer modules is module-init-tools (use the rpm command to determine what its config files are) The modules for the X.Y.Z.K kernel version are located at: /lib/modules/x.y.z.k/ Useful commands: lsmod insmod modprobe Exercize: cuales son los modules del Kernel en RAM que estan usados por el firewall?

Kernel (Documentation) Directory /Documentation BOOK: Linux kernel in a Nutshell, Oreilly, by Greg Kroah- Hartman This book is also freely downloadable in PDF format here: http://www.kroah.com/lkn/

Program Linux Distributions Installation process Documentation Users/Groups Filesystem/s Package management Automating tasks System services Run levels DNS Basics and config Basic host net cfg Kernel and Modules Logging

Program Linux Distributions Installation process Documentation Users/Groups Filesystem/s Automating tasks System services Run levels DNS Basics and config Basic host net cfg Package management Kernel and Modules Log files

Automating tasks cronie system service cron anacron crontabs

Program Linux Distributions Installation process Documentation Users/Groups Filesystem/s Automating tasks System services Run levels DNS Basics and config Basic host net cfg Package management Kernel and Modules Log files

System Services & Run Levels Run Levels: 0 1 2 3 4 5 6 / etc rc rc rc.local rc.sysinit rc.d rc0.d r1c.d r2c.d rc3.d rc4.d rc5.d rc6.d init.d Sservice_name vs Kservice_name

System Services & Run Levels init chkconfig System --> Administracion --> Services

Program Linux Distributions Installation process Documentation Users/Groups Filesystem/s Package management Automating tasks System services Run levels DNS Basics and config Basic host net cfg Kernel and Modules Log files

DNS Basic We will look at the theory when reviewing the networking basics. The DHCP server usually provides the info necessary to configure the local /etc/resolv.conf file. Host Config files: /etc/host.conf /etc/hosts /etc/resolv.conf

Program Linux Distributions Installation process Documentation Users/Groups Filesystem/s Automating tasks System services Run levels DNS Basics and config Basic host net cfg Package management Kernel and Modules Log files

Basic host net cfg Config files and scripts ifup/ifdown... /etc/sysconfig/ + /etc/resolv.conf /etc/hosts... system-config-network MENU: System / Administration / Network NetworkManager How to enable/disable it?

Copyright CC Creative Commons This presentation is released under the Creative Common License: Attribution, Noncommercial, Share Alike 2.5 (http://creativecommons.org/licenses/by-nc-sa/2.5/) Attribution You must attribute the work in the manner specified by the author or licensor. Noncommercial. You may not use this work for commercial purposes. Share Alike. If you alter, transform, or build upon this work, you may distribute the resulting work only under a license identical to this one.