Linux OS Fundamentals for the Windows Admin

Similar documents
LINUX OS FUNDAMENTALS FOR THE SQL ADMIN

Linux OS Fundamentals for the SQL Admin. Anthony E. Nocentino

Linux OS Fundamentals for the SQL Admin. Anthony E. Nocentino

Perl and R Scripting for Biologists

Introduction to Linux

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

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

Introduction to Linux

Linux for Beginners. Windows users should download putty or bitvise:

INTRODUCTION TO LINUX

Linux Essentials Objectives Topics:

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

Linux Kung-Fu. James Droste UBNetDef Fall 2016

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

client X11 Linux workstation

Monitoring Linux Performance for the SQL Server Admin. Anthony Nocentino, Enterprise Architect, Centino Systems

Community Enterprise Operating System (CentOS 7) Courses

Prerequisites: General computing knowledge and experience. No prior knowledge with Linux is required. Supported Distributions:

Monitoring Linux Performance for the SQL Server Admin. Anthony E. Nocentino, Enterprise Architect, Centino Systems

Command-line interpreters

Linux Systems Administration Getting Started with Linux

Linux Command Line Primer. By: Scott Marshall

Unix Processes. What is a Process?

UNIX. The Very 10 Short Howto for beginners. Soon-Hyung Yook. March 27, Soon-Hyung Yook UNIX March 27, / 29

Introduction to Linux

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

Chapter 1 - Introduction. September 8, 2016

Unit 2: Manage Files Graphically with Nautilus Objective: Manage files graphically and access remote systems with Nautilus

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

Introduction to Linux

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

INF322 Operating Systems

Part 1 : Getting Familiar with Linux. Hours. Part II : Administering Red Hat Enterprise Linux

Introduction to remote command line Linux. Research Computing Team University of Birmingham

IBM AIX Operating System Courses

Prerequisites: Students should be comfortable with computers. No familiarity with Linux or other Unix operating systems is required.

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

Introduction: What is Unix?

System Administration

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

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

Linux Fundamentals (L-120)

Linux Kung Fu. Stephen James UBNetDef, Spring 2017

Introduction to Linux

Introduction to Linux

Introduction. Let s start with the first set of slides

CS197U: A Hands on Introduction to Unix

Exam LFCS/Course 55187B Linux System Administration

LINUX FUNDAMENTALS. Supported Distributions: Red Hat Enterprise Linux 6 SUSE Linux Enterprise 11 Ubuntu LTS. Recommended Class Length: 5 days

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

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

UNIX Quick Reference

Course 55187B Linux System Administration

Prerequisites: Students must be proficient in general computing skills but not necessarily experienced with Linux or Unix. Supported Distributions:

www highskills pt pt

Outline. Structure of a UNIX command

Introduction to Linux

1Z Oracle Linux Fundamentals (Oracle Partner Network) Exam Summary Syllabus Questions

Linux System Administration

Unix Introduction to UNIX

LPIC-1 System Administrator

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

Presented by Bill Genske Gary Jackson

EECS2301. Lab 1 Winter 2016

Crash Course in Unix. For more info check out the Unix man pages -orhttp:// -or- Unix in a Nutshell (an O Reilly book).

Processes. Shell Commands. a Command Line Interface accepts typed (textual) inputs and provides textual outputs. Synonyms:

Filesystem Hierarchy Operating systems I800 Edmund Laugasson

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

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

LINUX FUNDAMENTALS (5 Day)

Filesystem and common commands

Introduction of Linux

CST Algonquin College 2

Course 144 Supplementary Materials. UNIX Fundamentals

Introduction To Linux. Rob Thomas - ACRC

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

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

Review of Fundamentals

(a) About Unix. History

The student will have the essential skills needed to be proficient at the Unix or Linux command line.

CSE 390a Lecture 1. introduction to Linux/Unix environment

CS Fundamentals of Programming II Fall Very Basic UNIX

Linux Training. for New Users of Cluster. Georgia Advanced Computing Resource Center University of Georgia Suchitra Pakala

Table of contents. Our goal. Notes. Notes. Notes. Summer June 29, Our goal is to see how we can use Unix as a tool for developing programs

Chapter-3. Introduction to Unix: Fundamental Commands

Operating Systems. Copyleft 2005, Binnur Kurt

Operating Systems 3. Operating Systems. Content. What is an Operating System? What is an Operating System? Resource Abstraction and Sharing

CISC 220 fall 2011, set 1: Linux basics

Linux Administration

How to Use This Lab Manual

RH033 Red Hat Linux Essentials

Unix/Linux: History and Philosophy

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

Introduction to Unix: Fundamental Commands

CSE 391 Lecture 1. introduction to Linux/Unix environment

CS4350 Unix Programming. Outline

Introduction to UNIX. Logging in. Basic System Architecture 10/7/10. most systems have graphical login on Linux machines

Introduction to Linux Basics

Operating Systems Linux 1-2 Measurements Background material

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

Transcription:

Linux OS Fundamentals for the Windows Admin Anthony E. Nocentino Enterprise Architect Centino Systems Level: Intermediate

Anthony E. Nocentino Consultant and Trainer Founder and President of Centino Systems Specialize in system architecture and performance Masters Computer Science Microsoft MVP - Data Platform - 2017 email: aen@centinosystems.com Twitter: @nocentino Blog: www.centinosystems.com/blog Pluralsight Author: www.pluralsight.com

Rules Ask questions during the session I talk fast, ask me to slow down it s cool

Overview Installing Linux Linux Architecture Interacting With Your Linux System I/O Redirection and Pipelines (break) File System Basics Working With PowerShell on Linux Working With Packages (break) Managing Services With systemd System Resource Management Getting Help

What is Linux? What is Linux? An operating system. Kernel and programs Where did Linux come from? Linus Torvalds and Richard Stallman Who are the major players? Red Hat, Debian, Ubuntu and you! Who s using Linux? Enterprise, Government, Hosting and you!

Getting Linux RedHat Subscriptions, Evaluation or Developer Clones CentOS, Scientific Linux and more

Basic Linux Installation Options Booting - DVD, USB, PXE Installation UI - Anaconda or Text Installation Sources - DVD, NFS, HTTP, FTP Software Selection - Server with GUI Network Configuration - hostname, IP and gateway Installation Destination - disk, RAID, FC, Xen, VirtIO

Virtual Consoles Main Root shell Installation logs Storage logs Program logs Installation interface Key sequence ctrl + alt + F1 ctrl + alt + F2 ctrl + alt + F3 ctrl + alt + F4 ctrl + alt + F5 ctrl + alt + F6

Installation Logs /tmp/anaconda.log - overview /tmp/program.log - programs run during installation /tmp/storage.log - storage module info /tmp/packaging.log - yum and rpm info /tmp/syslog - hardware related messages

Demo Installing CentOS from ISO Virtual Consoles Installation Logs

Linux Architecture User Space Users Interact with the Shell Cause Problems :) Shell Executes Your Commands Your Interface to the Kernel Commands, Editors any User Program Kernel Space Kernel Resource Management and Access Process, Memory and File Systems Hardware Physical Resources CPU, Disk and Memory

Interacting With Your Linux System Text Console SSH - Secure Shell Terminal (Linux/Mac) PuTTY (Windows) Graphically Desktop Manager VNC

What is a Shell? User interface Your interface into the kernel Command line interpreter The command prompt, where you enter commands Common Shells bourne (sh), bash (bash), C (csh) and many more

Executing Commands command option argument ls -la /home

bash s Features Basic bash features Command execution, aliases, variables, environment variables (PATH), tab completion Advanced bash features Job control, input and output redirection, pipes and scripts

bash s Features (con t) Keyboard Shortcuts (http://bit.ly/2hvlvpw) ctrl+a - move to the start of the line ctrl+e - move to the end of a line ctrl+l - clear the screen ctrl+z - backdrop the currently running task History Previously executed commands We can execute a command with!n

Switching Users Linux security is based on user ids root UID 0 # at the command prompt Try to avoid using root Regular Named Users UID >= 1000 $ at the command prompt [root@rhel1 ~]# [demo@rhel1 ~]$

Switching Users Switching users su - switch user, uses that users password sudo - Allows for users to execute and individual command with escalated privileges. Your password.

Demo Interacting with your system Keyboard shortcuts and job control Command History Access and privileged access Switching Users

What is a Process Process Executing program, program code, memory and resources Process Creation fork - parent process yields a child process with a PID Process Tree The hierarchy of parent and it s child processes

What is a Process (con t) Viewing and monitoring processes ps, top, ps --forest, gnome-system-monitor Process States Running, Sleeping, Runnable, Stopped and Zombie Running Stopped Zombie Runnable Sleeping

Controlling Processes Signals Methods of process control kill and killall Niceness Set the execution priority nice and renice Default 20, lower is less nice

Demo Process Viewing and monitoring a process States Signals

Many UNIX programs do quite trivial things in isolation, but, combined with other programs, become general and useful tools Kernighan and Pike

I/O Redirection keyboard file fd0 stdin fd1 stdout terminal file fd2 stderr file process

Text Based Pipelines keyboard fd0 stdin fd1 stdout fd0 stdin fd1 stdout terminal fd2 stderr fd2 stderr ls more process group

I/O Redirection Redirect standard output - stdout ( > and >> ) Normally directed to the terminal Useful for redirecting the output of a command to file or another process Redirect standard input - stdin ( < and << ) Normally input via keyboard Useful for directing input into a program from a file Redirect standard error - stderr ( 2> ) Normally output to terminal Useful for separating error output from standard output and redirect to another location

Using Pipelines Using a pipe - ( ) Interprocess communication Process groups Internal buffers

Demo I/O Redirection Text Based Pipelines

The Linux File System Everything is a file - No really, EVERYTHING! File system tree The most common analogy Filesystem Hierarchy Standard (FHS) The standard UNIX filesystem layout Mounts

Standard Directories / Top level of the file system, all resources are attached here /boot Required to boot the system, kernel and boot configuration /etc System configuration files /root The root user s home directory

Standard Directories /usr Programs, configuration, headers, libraries, and more /usr/bin Critical binaries for operating the system /usr/sbin System administration binaries for administering the system /var Variable data, print spools, mail, logs, temp files and more

Special Directories - Virtual File System /dev Shows all connected devices. Character and block modes /proc Runnings state of the kernel on the system. You can see processes, hardware and memory information /tmp A temporary space for any application (not like swap space)

File and Directory Permissions file type owner group -rwxrw-r-- 1 demo demo others links owner group 21 Aug 1 16:47 file1 file size date file name

Changing File and Directory Ownership -rw-rw-r--. 1 demo demo 21 Aug 1 16:47 file1 owner group chown - change file ownership and group chgrp - change group ownership

Octal Notation 3 bits - Used to represent permissions 2 3 = 8 possible permissions, 0 through 7 Read Write Execute e 4 2 1 Octal Permission 0 0 0 0 No Access 0 0 1 1 Execute 0 1 0 2 Write 0 1 1 3 Write and Execute 1 0 0 4 Read others group owner chmod 664 file1 1 0 1 5 Read and Execute 1 1 0 6 Read and Write 1 1 1 7 Full Control

Examples in Octal Notation Everyone read, write and execute chmod 777 file1 Read and write only to the owner chmod 600 file1 Read and write to the owner and group and execute to other chmod 661 file1

Common File and Directory Operations File Operations Directory Operations Create Create touch mkdir Delete Delete rm rm Move/Rename rmdir mv Move/Rename View Contents mv cat View Contents less/more ls head/tail

Demo The Linux File System File and Directory Permissions

Break Time 15 Minutes Restarting at 3:45

Working with PowerShell on Linux Y all are Windows admins, right PowerShell! PowerShell Core - Available now in Beta5 (monthly) Windows PowerShell - Version 5.1 Goal is to be cmdlet compatible with Windows PowerShell.NET Core 2, implements.net Standard 99% of.net Full CLR is now available Installation instructions here - http://bit.ly/2hvf5vy PowerShell can be used as your default Linux shell http://bit.ly/2ifokun

Demo Building command pipelines in PowerShell Heterogenous Pipelines

RPM Package Manager (RPM) Package Management System A package is a collection of programs, scripts and meta data Suite of management tools Used to install/upgrade/remove packages Does not provide dependency management apt

yum Package manager Dependency management Software is stored in repositories Software publishers {RedHat, CentOS} Third Party {EPEL, RPMForge} Your own System wide updates apt

Demo Package management with yum Install SQL Server on Linux from Microsoft s yum repository

How Does a Linux System Boot? BIOS/UEFI Bootable Device (MBR/GPT) Boot loader (GRUB) Kernel init - pid 1

What is init? First user process on the computer Parent to all processes Responsible for the orderly startup of services Controls the state of the system Presents a usable system to the user

init Systems System V (initd) systemd

systemd Features and Capabilities Service Control - systemctl Verifying Services are Running Units and Unit Files Dependencies before/after Viewing Logs - journalctl Control Groups

Demo systemctl status stop start enable disable

System Resource Management CPU Load average and run queues Disk Space and latency, IO waits Memory Memory pressure and swapping Network Throughput, latency and reliability

Basic Tools for Monitoring Included with your OS or it s repositories top free -m vmstat du -chs./dir df -h netstat -s

Tools for Monitoring Performance sysstat iostat, cifsiostat, nfsiostat sar - system activity reporter dstat Used to measure resource statistics in a single package Performance Swiss Army Knife

Perfomance Monitoring System Windows Linux Tool Linux CPU %Processor Time top CPU usage, load average Memory %Committed bytes in use free -m Total, used, free, cache Disk - Space %Free Space df -h Total, used, available, mount Disk - IOs Disk Transfers/sec iostat -dx tps, r/s, w/s Disk - Latency Disk - IO Size Interface Avg. Disk Sec/ Transfer Avg. Disk Bytes/ Transfer Bytes/Sec iostat -dx iostat -dx ifstat/bwm-ng/ nload/netstat -s svctm*** avgrq-sz Packets/sec, bits/sec

Demo System Resource Management top and ps free -m vmstat dstat

Getting Help man pages Local documentation /usr/share/doc Documentation about all of the install packages on your system Help files Example and default configuration files

Demo man pages /usr/share/doc

Key Takeaways It s just an operating system, once you get over the syntax and environmental changes A lot of the concepts are the same Architecture I/O redirection and text based pipelines File system basics

Key Takeaways (con t) PowerShell on Linux Packages systemd System resource management

Additional Resources Pluralsight Understanding and Using Essential Tools for Enterprise Linux 7 Installation, command execution, managing files Using VI, Advanced Shell Topics and Pipelining LFCE - Advanced Network and System Administration Managing services, performance monitoring, package management, NFS and Samba Play by Play: Microsoft Open Source PowerShell and Linux and Mac Where PowerShell fits in a heterogenous data center Remoting, Linux management tasks, PowerShell functions and DSC

Need more data or help? http://www.centinosystems.com/blog/talks/ Links to resources Demos Presentation aen@centinosystems.com @nocentino www.centinosystems.com

Questions???

Dinner? Dine Around 6:30PM - Hyatt Regency Bellevue 7:30PM - Lot No. 3 Limited to 8 attendees, 2 confirmation so far! Topic - OpenSource, Linux, PowerShell and SQL Server

Thank You! Please fill out those evaluations