Linux Administration Essentials: A Comprehensive Training Program

Slide Note
Embed
Share

Join the Cooper Union Retraining Program at CAMBA for an intensive course on Linux (Unix) Administration instructed by Dr. Tavaris J. Thomas. Learn core objectives spanning from file system management to network configuration without diving into hacking or programming. Explore the history of Linux, obtain operating systems, and discover common architectures in this hands-on session. Download distributions like Fedora, CentOS, Debian, and Ubuntu to get started. No previous Linux experience required!


Uploaded on Sep 16, 2024 | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

E N D

Presentation Transcript


  1. The Cooper Union Retraining Program at CAMBA Linux (Unix) Administration Instructor Tavaris J. Thomas, Ph.D.

  2. Core Objectives Getting started with windows environment edit text files with gedit/vi/vim Understand Linux file system hierarchy and pathnames; manage files from the command line. Understand Linux file access mechanisms; manage file access from the GUI and the command line. Access documentation, both locally and online. Configure the date and time. Understand basic disk concepts and manage system disks. Understand logical volume concepts and manage logical volumes. Manage CPU, memory, and disk utilization. Manage system software locally Understand basic shell concepts, execute simple commands, and use basic job control techniques. Use man and info pages and find documentation in /usr/share/doc. Understand basic network concepts; configure, manage, and test network settings. Manage users and groups. Share and connect to a desktop; use SSH Understand run-levels (targets) and manage GRUB. Deploy an FTP server and a web server.

  3. Welcome! Do I need any previous Linux experience? Who am I? Which Linux version is best for me? Where is the closest help resource? (puns intended ) whoami which whereis

  4. Course Objectives we will not learn Hacking BlackHat Techniques Penetration Testing Programming (beyond simple scripting) Developing/building your own kernel or modifications. However, I will try to introduce Linux concepts to you with a security minded approach.

  5. Linux Admin Session 1 Outline Brief History of Linux Obtaining the Operating System Assistance, Resources, and Information Common Architectures Assistance, Resources, and Information Shells and Scripting Booting Procedures Shutdown Procedures

  6. (Brief) History of Linux UNIX Developed by Dennis Ritchie and Ken Thompson at AT&T Bell Labs 1970s Heavy license fees for UNIX spurred the development of the reimplementation of an open sourced version UNIX In 1991 Linus Torvalds (Li) + UNIX (nux) = Linux

  7. Downloading the distribution(s) Fedora (RedHat) CentOS http://fedorproject.org http://www.centos.org Debian (open) Ubuntu http://www.debian.org http://www.ubuntu.com Virtual Machines are your friend VMware, Parallels, Microsoft, Virtual Box, etc

  8. Installing your distribution Stand alone Virtual Machine http://www.virtualbox.org Live CD Dual/multiple boot

  9. Assistance, Resources, and Information Email me tavaris@gmail.com Online: http://www.computerhope.com/unix/overview.htm HOW TO guides - Google Linux Where to go for information???? $man topic $info topic $info emacs (an excellent tutorial for info)

  10. Secure Installation Security begins with the first time you put that CD or DVD into your disk drive (or .iso for VM) to install Linux. Configuring your system securely from the beginning makes it easier to implement additional security settings later. NIST recommends creating separate partitions for /boot, /, /home, /tmp, and /var/tmp.

  11. Common Architectures Hardware Keyboard, hard drives, processors, memory, optical drives, etc Kernel Device drivers, network stack, memory interface/mapping, etc Shell Command Line Interface Applications/GUI Desktop env, web browser, terminal, etc

  12. User Space and Kernel Space User Space User space refers to all of the code in an operating system that lives outside of the kernel. Most Unix-like operating systems (including Linux) come pre-packaged with all kinds of utilities, programming languages, and graphical tools - these are user space applications. Kernel Space The kernel provides abstraction for security, hardware, and internal data structures.

  13. What is the shell??? The shell acts as a buffer between the user and the machine, taking input from the user and interpreting it to the computer. The shell has several associated environment variables that it uses to keep track of information, including the current directory and where to look for files and applications. The shell can be used as a mini-programming environment, to execute a series of commands (i.e. a script) The terminal application can be viewed as a program that provides an interface that can accept user input from the keyboard and display characters on-screen for the user. The default shell is bash (the Bourne-again shell) sh - (the original Bourne shell) It was developed by Stephen Bourne at Bell Labs in 1977 for Unix Version 7. source: Wikipedia

  14. Scripting Scripts standardize and automate the performance of administrative duties. Scripts vary in complexity from simple ones that encapsulate a few static commands to major software projects that manage host configurations and administrative data for an entire organization. cron - the name for scripts that run on a regular basis

  15. When NOT to use scripts Resource-intensive tasks, especially where speed is a factor (sorting, hashing, recursion) Procedures involving heavy-duty math operations, especially floating point arithmetic, arbitrary precision calculations, or complex numbers (use C++ or FORTRAN instead) Mission-critical applications upon which you are betting the future of the company Extensive file operations required (Bash is limited to serial file access, and that only in a particularly clumsy and inefficient line-by-line fashion.) Need native support for multi-dimensional arrays Need data structures, such as linked lists or trees Need to generate / manipulate graphics or GUIs Proprietary, closed-source applications (Shell scripts put the source code right out in the open for all the world to see.)

  16. Shells and Scripting Why?? - Most environments include a hefty complement of existing sh scripts, and those scripts frequently need to be read, understood, and tweaked by administrators. Every process has at least three communication channels available to it: standard input (STDIN 0 ), standard output (STDOUT 1), and standard error (STDERR 2). Source: Wikipedia

  17. Shells and Scripting cont The shell interprets the symbols <, >, and >> as instructions to reroute a command s input or output to or from a file. < symbol directs STDIN to the contents of an existing file. > and >> symbols redirect STDOUT; >> appends to file Examples find / -name core > test 2>&1

  18. Shells and Scripting cont To redirect both STDOUT and STDERR to the same place, use the >& symbol. To redirect STDERR only, use 2> . The | symbols takes the output of one command and redirects it to the input of another. (example) && - executes a second command only if first command completes successfully || symbol executes the following command only if the preceding command fails.

  19. Linux Terminology A daemon is a background, non-interactive program A service is a program which responds to requests from other programs over some inter-process communication mechanism (usually over a network). Process - Process is a running program. - running, sleeping, or zombie (completed process, but waiting for it's parent process to pick up the return value). A job is any program that you interactively start (within the shell) and that does not detach itself.

  20. Bootstrap Process bootstrap procedures: Loading and initialization of the kernel Device detection and configuration Creation of kernel threads (manual boot control - optional) Execution of startup scripts Multiuser operations

  21. Booting the PC Startup your Linux distribution Power on & BIOS Loading the boot loader Master Boot Record (MBR) contains the location of the boot loader BOOT LOADERS GRUB The GRand Unified Boot loader LILO the traditional Linux boot loader

  22. GRUB Installed on most distributions Very useful booting multiple operating systems, kernels, configurations, etc Good for users that change configurations often GRUB configuration (accessed at boot time) is located at: /boot/grub2/grub.cfg

  23. CentOS run-level Previous versions of Red Hat Enterprise Linux, which were distributed with SysV init or Upstart, used init scripts located in the /etc/rc.d/init.d/ directory. In general, users operate Red Hat Enterprise Linux at run-level 3 or run-level 5 both full multi-user modes. These init scripts were typically written in Bash, and allowed the system administrator to control the state of services and daemons in their system. In CentOS 7 and later, these init scripts have been replaced with service units controlled by systemd.

  24. systemd systemd is a system and service manager for Linux In Red Hat Enterprise Linux 7 and later, the concept of run-levels has been replaced with systemd targets. Systemd initializes user space components that run after the Linux kernel has booted, as well as continuously maintaining those components throughout a system s lifecycle. These tasks are known as units, and each unit has a corresponding unit file.

  25. systemd contd Units might concern mounting storage devices (.mount), configuring hardware (.device), sockets (.socket), or, managing services (.service). Systemd targets are represented by target units. Target units end with the .target file extension and their only purpose is to group together other systemd units through a chain of dependencies

  26. systemctl systemctl is a controlling interface and inspection tool for the widely-adopted init system and service manager systemd. Service units end with the .service file extension and serve a similar purpose as init scripts. To view, start, stop, restart, enable, or disable system services, use the systemctl command The service and chkconfig commands are still available in the system and work as expected, but are only included for compatibility reasons and should be avoided.

  27. Run Levels

  28. Checking/changing run-levels Try the following command: # systemctl get-default This shows the current default run-level Try another commands: # systemctl list-units --type=target # systemctl set-default multi-user.target

  29. Rebooting and Shutting Down halt instructs the hardware to stop all CPU functions. poweroff sends an ACPI signal which instructs the system to power down. reboot instructs the system to reboot. Suspend does not turn off your computer. It puts the computer and all peripherals on a low power consumption mode. If the battery runs out or the computer turns off for some reason, the current session and unsaved changes will be lost. Hibernate saves the state of your computer to the hard disk and completely powers off. When resuming, the saved state is restored to RAM.

  30. Rebooting and Shutting Down In Red Hat Enterprise Linux 8, the systemctl utility replaces a number of power management commands used in previous versions of the Red Hat Enterprise Linux system.

  31. How to reset root http://www.unixmen.com/reset-root-password- centos-7/ CentOS 7 Edit Grub (previous slide) Go to the line of Linux 16 and change ro with rw init=/sysroot/bin/sh chroot /sysroot passwd root touch /.autorelabel exit reboot

  32. Assignment 1 Download and install a copy of CentOS 7 using one of the methods described in this chapter Read chapters 1 and 2 of text. Practice commands presented during class

More Related Content