SYSTEM ADMINISTRATION PART I by İlker Korkmaz and Kaya Oğuz

Slides:



Advertisements
Similar presentations
Linux Users and Groups Management
Advertisements

Basic Unix system administration
Chapter One The Essence of UNIX.
CS 497C – Introduction to UNIX Lecture 26: - The Process Chin-Chih Chang
Linux+ Guide to Linux Certification, Second Edition
Lesson 22 – Introduction to Linux Systems Administration.
Processes & Daemons Chapter IV / Part III. Commands Internal commands: alias, cd, echo, pwd, time External commands, code is in a file: grep, ls, more.
Lecture 02CS311 – Operating Systems 1 1 CS311 – Lecture 02 Outline UNIX/Linux features – Redirection – pipes – Terminating a command – Running program.
Objectives  Understand the purpose of the superuser account  Outline the key features of the Linux desktops  Navigate through the menus  Getting help.
70-293: MCSE Guide to Planning a Microsoft Windows Server 2003 Network, Enhanced Chapter 14: Problem Recovery.
Guide to Linux Installation and Administration, 2e1 Chapter 8 Basic Administration Tasks.
Unix System Administration Rootly Powers Chapter 3.
CIS 191 – Lesson 2 System Administration. CIS 191 – Lesson 2 System Architecture Component Architecture –The OS provides the simple components from which.
Managing User Accounts. Module 2 – Creating and Managing Users ♦ Overview ► One should log into a Linux system with a valid user name and password granted.
Managing Processes CSCI N321 – System and Network Administration Copyright © 2000, 2011 by Scott Orr and the Trustees of Indiana University.
Linux+ Guide to Linux Certification, Third Edition
Chapter Eight Exploring the UNIX Utilities. 2 Lesson A Using the UNIX Utilities.
CS 390 Unix Programming Summer Unix Programming - CS 3902 Course Details Online Information Please check.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 6 System Calls OS System.
SUSE Linux Enterprise Server Administration (Course 3037) Chapter 6 Manage Linux Processes and Services.
Guide To UNIX Using Linux Third Edition Chapter 8: Exploring the UNIX/Linux Utilities.
Guide to Linux Installation and Administration1 Chapter 4 Running a Linux System.
Managing Users  Each system has two kinds of users:  Superuser (root)  Regular user  Each user has his own username, password, and permissions that.
Linux+ Guide to Linux Certification, Second Edition Chapter 10 Managing Linux Processes.
Guide To UNIX Using Linux Third Edition Chapter 8: Exploring the UNIX/Linux Utilities.
Hands On UNIX II Dorcas Muthoni. Processes A running instance of a program is called a "process" Identified by a numeric process id (pid)‏  unique while.
EMT 2390L Lecture 5 Dr. Reyes Reference: The Linux Command Line, W.E. Shotts.
Chapter 3 & 6 Root Status and users File Ownership Every file has a owner and group –These give read,write, and execute priv’s to the owner, group, and.
A Practical Guide to Fedora and Red Hat Enterprise Linux Unit 9: Basic Linux Administration Chapter 11: System Administration: Core Concepts Chapter 16:
Introduction to System Admin Sirak Kaewjamnong. 2 The system administration’s job  Adding a new user  Doing backup and restoring files from backups.
1 LINUX SECURITY. 2 Outline Introduction Introduction - UNIX file permission - UNIX file permission - SUID / SGID - SUID / SGID - File attributes - File.
Advanced Programming in the UNIX Environment Hop Lee.
Linux Commands C151 Multi-User Operating Systems.
System Administration. Logging in as System Administrator System Admin login (aka superuser, aka root) –login id: root –Default PS1 prompt: # –Home directory:
Module 1 - Introduction to Linux. Users must log-in Linux is case sensitive File and Directories naming conventions (No spaces!) Files and Directories.
CSC414 “Introduction to UNIX/ Linux” Lecture 6. Schedule 1. Introduction to Unix/ Linux 2. Kernel Structure and Device Drivers. 3. System and Storage.
Lecture 02 File and File system. Topics Describe the layout of a Linux file system Display and set paths Describe the most important files, including.
The Kernel At a high level, the kernel in an operating system serves as the bridge between applications and the actual data processing of the hardware.
Chapter Eight Exploring the UNIX Utilities. 2 Lesson A Using the UNIX Utilities.
CSC414 “Introduction to UNIX/ Linux” Lecture 3
Agenda Managing Processes (Jobs) Command Grouping Running jobs in background (bg) Bringing jobs to foreground (fg), Background job status (jobs) Suspending.
Unix System Administration Controlling Processes Chapter 5.
Agenda The Bourne Shell – Part I Redirection ( >, >>,
An Introduction to processes R Bigelow. A Unix Process A process in Unix is simple a program The Unix system is made up of a group of processes all interacting.
Lecture 4 & 5: System Architecture  File systems  Devices  File system permissions  Review of Linux runlevels  In-class exercise.
ORAFACT The Linux File System. ORAFACT Filesystem Support Support for dozens of filesystem types including: Minix, ext2, MS-DOS, UMSDOS, VFAT, NTFS, NFS,
Company LOGO Security in Linux PhiHDN - VuongNQ. Contents Introduction 1 Fundamental Concepts 2 Security System Calls in Linux 3 Implementation of Security.
PROGRAMMING THE BASH SHELL PART III by İlker Korkmaz and Kaya Oğuz
...looking a bit closer under the hood
...looking a bit closer under the hood
Rootly Powers and Controlling Processes
Hands On UNIX AfNOG 2010 Kigali, Rwanda
Chapter 4 Booting and Shutdown
9 Linux on the Desktop.
Ubuntu Working in Terminal
PROGRAMMING THE BASH SHELL PART IV by İlker Korkmaz and Kaya Oğuz
Hands On UNIX AfNOG X Cairo, Egypt
Linux Users and Groups Management
IS3440 Linux Security Unit 4 Securing the Linux Filesystem
Unix : Introduction and Commands
...looking a bit closer under the hood
OPS235: Week 1 Installing Linux (Lab1: Investigations 4 - )
The Linux Command Line Chapter 9
OPS235: Week 1 Installing Linux ( Lab1: Investigations 1-4)
Working with Mac OS and Linux
Controlling Processes
Rootly Powers Chapter 3.
1.3 Given a scenario, apply appropriate Microsoft command line tools
Access Control and Audit
Presentation transcript:

SYSTEM ADMINISTRATION PART I by İlker Korkmaz and Kaya Oğuz CS350 Lecture11 SYSTEM ADMINISTRATION PART I by İlker Korkmaz and Kaya Oğuz

System Administration As pointed in syllabus document, there will be 2 lecture weeks to cover the privileged administration issues. This lecture is the first part on system administration.

References The contents of this lecture are prepared with the help of and based on: the textbook, UNIX Shells by Example (Chapter16) the tutorial, Advanced Bash-Scripting Guide at http://tldp.org/LDP/abs/html/ the tutorial, The Linux System Administrator's Guide at http://tldp.org/LDP/sag/html/index.html Linux System Administration, by Tom Adelstein & Bill Lubanovic, an O'Reilly book.

Contents of Lecture11 Superuser term, setuid programs Kernel, init, run level terms User administration Installing/Removing software Backing up system Managing disk space Managing processes System monitoring

Why to cover a lecture on system administration issues? You need to understand the basics of system administration at least for the reasons that either you will work as an administrator of an active multi-user system or you will only manage your system with privileged permissions. This lecture is not a whole guide to system administration, rather only an introduction to system administration in respect to the Linux shell.

Superuser The terms superuser and root are often used interchangeably. Regular accounts have access only to the files and processes they own or that give them specific permissions, such as groups and other. Superuser accounts have access to all the files and processes on the system. The superuser is omnipotent and has no restriction. A superuser's user identification number (uid) is 0 and related shell prompt is a pound sign (#).

Becoming a superuser Traditionally, when an administrator wants to run any command requiring root privileges, he/she logs onto an unprivileged account first, and then uses the su command to switch to a superuser. A new root-owned shell will be started, and after running privileged commands, the superuser will exit from the root shell and return to the unprivileged user. sudo may be used in scripts to run a particular command as root (or another user).

System administrator responsibility on scripts If you are an administrator of a system, or you have the superuser rights test your any script carefully before taking it to the system level. An unexpected error could bring a whole system to its knees.

Running scripts as root Root's PATH does not include “.” (dot). # myScript # refers to root's prompt sign at command line The above command fails for a root Correct usage alternatives: # ./myScript # /bin/bash myScript

Scripts that run as root (setuid programs) Whoever runs the setuid program temporarily becomes the owner of that program and has the same permissions as the owner. To identify a setuid program, try ls -l The x permission will be replaced with an s if the program is a setuid program. passwd is a good example to explain the illusion: When you change your password you temporarily switch to root permissions, but only during the execution of passwd program. By the way, you are able to change the password without going to a system administrator.

System administrator responsibility on setuid scripts A shell script may be written as a setuid program and it is a serious security threat if not monitored by the administrator. If a shell script is a setuid program, the shell spawned is a root owned shell and commands executed from the script are run as root. Bash does not support setuid programs, Korn shell has a privileged mode only if allowed by the OS.

Required terminology Understand the following terms: kernel init process PID daemon initialization (init) scripts At the beginning of this CS350 course, we have understood the terms kernel, init, process, PID, aren't we? When the system boots the UNIX/Linux kernel is loaded from disk. It is the program that manages the OS from boot-up to hut-down. Firstly, it initializes device drivers, starts the swapper, and mounts the root filesystem (/). Then, it creates the first process init.

Run level A run level, also called system state, determines which set of processes are available on the system. Usually there are 8 run levels: 0-6 and s (or S) Those run levels are categorized in three main states: halted run level 0 UNIX is not running in this state single-user run level is either 1 or S only root is logged on multiuser run levels 2-5 multiuser mode allows users to log into the system The command “who -r” shows the run level of current init process. The command “init 0” tries to move the system into run level 0, which is a halted state, and so that command tries to shut the system down.

User administration Account: http://tldp.org/LDP/sag/html/account.html Users and groups: http://tldp.org/LDP/abs/html/system.html

Installing software To install a software from scratch: build from source code: First get the source files, then usually: In the corresponding directory, $ ./configure $ make $ make install An example guide to write a script to install programs after a fresh install of Ubuntu Linux: http://ubuntuforums.org/showthread.php?t=290764

Removing software Usually, users do not remove a software, upgrade instead. If disk space issue becomes problematic, to remove some unused softwares is also considered. Then, usually the related interactive system management package of the system is used, such as Synaptic Package Manager in Ubuntu. or the related commands are used to uninstall and remove the packages, such as “apt-get remove” command in Ubuntu.

Backing up system Types: full backup differential backup includes changes since last full backup incremental backup Includes changes since last backup The administrator should have a backup strategy Which type on which schedule When to backup What to backup

Main backup tools tar to archive files rsync to backup to a remote server

Managing disk space To save disk space, archiving may be preferred. The administrator may need to monitor the disk usages of users df shows the free space on a partition du shows information about disk space used in a directory

Managing processes Process management create/monitor/kill processes A process is a program running on the system.

Managing processes: creation The kernel identifies the processes with their id numbers, pid. A process has a user id, uid, and a group id, gid. A process has a ppid as the parent process id. The system starts with an init process with the id 1 at boot-up and other processes are descendants of pid 1.

Managing processes: monitor ps command gives the snapshot of the processes running on a system at that moment. pstree command also works similar to “ps -f”

Managing processes: kill A process can be sent a signal. kill command is used to send a signal to a process. (kill is not just used to terminate a process) KILL is one of the commonly used signals.

System monitoring The administrator needs to monitor the system. However, it is not so easy to clarify the events to be monitored. That's more likely to be handled through the know-how experiences. Daemon-Monitoring Daemon concept: A daemon is mainly a process that runs in the background and provides some particular services. A daemon-monitoring daemon (DMD) is a utility that watches the daemons (services) automatically to restart them when they fail.

Next week? System administration issues will also be continued in the next lecture. Basic concepts will include boot scripts, daemons, and some popular services. Some issues shall be demonstrated on our Faculty server, “zeytin”.