Exercise Sheet 2. (Classifications of Operating Systems)

Similar documents
Introduction to Unix May 24, 2008

Übungsblatt 2. Aufgabe 1 (Klassifikationen von Betriebssystemen)

Permission and Ownership

CENG 334 Computer Networks. Laboratory I Linux Tutorial

CISC 220 fall 2011, set 1: Linux basics

CST8207: GNU/Linux Operating Systems I Lab Six Linux File System Permissions. Linux File System Permissions (modes) - Part 1

Week 2 Lecture 3. Unix

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

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

CSE II-Sem)

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

Exploring UNIX: Session 3

Introduction to Linux Workshop 1

: the User (owner) for this file (your cruzid, when you do it) Position: directory flag. read Group.

CS Fundamentals of Programming II Fall Very Basic UNIX

Introduction: What is Unix?

CSE 390a Lecture 3. Multi-user systems; remote login; editors; users/groups; permissions

Chapter 8: Security under Linux

INTRODUCTION TO LINUX

Linux Tutorial #6. -rw-r csce_user csce_user 20 Jan 4 09:15 list1.txt -rw-r csce_user csce_user 26 Jan 4 09:16 list2.

Using UNIX. -rwxr--r-- 1 root sys Sep 5 14:15 good_program

Working with Basic Linux. Daniel Balagué

Introduction to the Linux Command Line

Outline. Structure of a UNIX command

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

commandname flags arguments

Linux Kung-Fu. James Droste UBNetDef Fall 2016

Contents. Note: pay attention to where you are. Note: Plaintext version. Note: pay attention to where you are... 1 Note: Plaintext version...

Operating systems fundamentals - B10

A Big Step. Shell Scripts, I/O Redirection, Ownership and Permission Concepts, and Binary Numbers

Introduction to Linux

Introduction to the UNIX command line

Unix Groups and Users

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

Scripting. Shell Scripts, I/O Redirection, Ownership and Permission Concepts, and Binary Numbers

CS246 Spring14 Programming Paradigm Notes on Linux

CS 215 Fundamentals of Programming II Spring 2019 Very Basic UNIX

CST Lab 2 Review #1

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

Privileges: who can control what

read: permitted to read the contents of directory ( view files and sub-directories in that directory ).

Lab Authentication, Authorization, and Accounting

CS4350 Unix Programming. Outline

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

Hitchhiker s Guide to VLSI Design with Cadence & Synopsys

Mills HPC Tutorial Series. Linux Basics I

CSN08101 Digital Forensics. Module Leader: Dr Gordon Russell Lecturers: Robert Ludwiniak

1. What statistic did the wc -l command show? (do man wc to get the answer) A. The number of bytes B. The number of lines C. The number of words

5/8/2012. Encryption-based Protection. Protection based on Access Permission (Contd) File Security, Setting and Using Permissions Chapter 9

DAVE LIDDAMENT INTRODUCTION TO BASH

Goals for This Lecture:

CSE 303 Lecture 4. users/groups; permissions; intro to shell scripting. read Linux Pocket Guide pp , 25-27, 61-65, , 176

CSC209. Software Tools and Systems Programming.

Course 144 Supplementary Materials. UNIX Fundamentals

Introduction to Linux

acmteam/unix.pdf How to manage your account (user ID, password, shell); How to compile C, C++, and Java programs;

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

The Unix Shell & Shell Scripts

A Brief Introduction to Unix

Introduction to Lab Practicals (Lab Intro 3) Access Control, Synchronisation and Remote Access

Lab Working with Linux Command Line

Unix Introduction to UNIX

bash startup files Linux/Unix files stty Todd Kelley CST8207 Todd Kelley 1

LING 408/508: Computational Techniques for Linguists. Lecture 5

Unix Basics. UNIX Introduction. Lecture 14

CENG393 Computer Networks Labwork 1

Linux Kung Fu. Ross Ventresca UBNetDef, Fall 2017

INSE Lab 1 Introduction to UNIX Fall 2017

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

CS 460 Linux Tutorial

UNIX / LINUX - GETTING STARTED

CS/CIS 249 SP18 - Intro to Information Security

The UNIX operating system is a set of programs that act as a link between the computer and the user.

Introduction to Lab Practicals (Lab Intro 3) Access Control, Synchronisation and Remote Access

Getting Started with Linux

Case Study: Access Control. Steven M. Bellovin October 4,

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

Introduction to UNIX. SURF Research Boot Camp April Jeroen Engelberts Consultant Supercomputing

Outline. UNIX security ideas Users and groups File protection Setting temporary privileges. Examples. Permission bits Program language components

LOG ON TO LINUX AND LOG OFF

Basic File Attributes

Group Editing of Files and Web Sites

CSE 390a Lecture 4. Persistent shell settings; users/groups; permissions

Quick Start Guide. by Burak Himmetoglu. Supercomputing Consultant. Enterprise Technology Services & Center for Scientific Computing

Introduction to Unix and Linux. Workshop 1: Directories and Files

System Administration

This lab exercise is to be submitted at the end of the lab session! passwd [That is the command to change your current password to a new one]

Assume that username is cse. The user s home directory will be /home/cse. You may remember what the relative pathname for users home directory is: ~

Files (review) and Regular Expressions. Todd Kelley CST8207 Todd Kelley 1

Operating Systems, Unix Files and Commands SEEM

LAB #7 Linux Tutorial

CSC209. Software Tools and Systems Programming.

Linux basics U3A in Bath. Linux Principles. by Andy Pepperdine

Introduction in Unix. Linus Torvalds Ken Thompson & Dennis Ritchie

genome[phd14]:/home/people/phd14/alignment >

UNIX Tutorial Five

. Fill in the Blank: A directory named mydir has just been... Points:10. Add Question Success: 64 questions added as a copy.

A Brief Introduction to the Linux Shell for Data Science

Linux Systems Administration Getting Started with Linux

PROGRAMMAZIONE I A.A. 2015/2016

Transcription:

Exercise Sheet 2 Exercise 1 (Classifications of Operating Systems) 1. At any given moment, only a single program can be executed. What is the technical term for this operation mode? 2. What are half multi-user operating systems? 3. What is the difference between 8 bit, 16 bit, 32 bit and 64 bit operating systems? 4. What are the essential criteria of real-time operating systems? 5. Name the two types of real-time operating systems. 6. Name four typical application areas of real-time operating systems and assign each application area to one of the categories of subtask 5. 7. Describe the structure of a thin kernel. 8. Describe the structure of a nano kernel. 9. Describe the structure of a monolithic kernel. 10. Describe the structure of a microkernel. 11. Describe the structure of a hybrid kernel. 12. GNU HURD implements a... 13. Linux implements a... 14. MacOS X implements a... 15. Windows NT4/Vista/XP/7/8 implements a... 16. Name one advantage and one drawback of monolithic kernels. 17. Name one advantage and one drawback of microkernels. 18. Name one advantage and one drawback of hybrid kernels. Content: Topics of slide set 2 Page 1 of 7

19. Your colleague recommends you to relocate frequently used server daemons, such as web server, email server, SSH server and FTP server, from user mode to kernel mode. How do you feel about this idea? Give reasons for your answer. Name a benefit and a drawback. 20. What means Single System Image? Exercise 2 (Basic Linux/UNIX commands) Which command is used to... 1. check the man pages? 2. print out the present working directory in the shell? 3. create a new directory? 4. navigate to a directory? 5. print out the content a directory in the shell? 6. create an empty file? 7. try to determine the content of a file? 8. concatenate the content of files with other files and can also be used to print out the content of a file? 9. print out lines from the end of a file in the shell? 10. print out lines from the beginning of a file in the shell? 11. copy files or directories to a different location? 12. move files or directories to a different location? 13. delete files or directories? 14. delete an empty directory? 15. place a string in the shell? 16. modify the permissions of the file or directory? 17. change the password of a user? 18. terminate a session (and thus shell) and allows to specify the return value of she shell script? 19. reboot the system? Content: Topics of slide set 2 Page 2 of 7

20. shut the system down? 21. create a new user? 22. delete a user? 23. modify a user? 24. print out the group memberships of a user? 25. create a new group? 26. delete a group? 27. change a group? 28. change the user (= ownership) which is associated with a file or directory? 29. change the group which is associated with a file or directory? 30. create a link? 31. search a file for lines which contain a search pattern? 32. print out a list of running processes in the shell? 33. bring a process, running in the backgrund of the shell, into foreground? 34. bring a process into the background of the shell? 35. kill (terminate) a process? 36. kill (terminate) a group of processes? 37. specify the priority of a new process? 38. modify the priority of an existing process? 39. print out the process tree in the shell? Exercise 3 (Permissions / Access Rights) The source of this tutorial is: http://www.ws.afnog.org/afnog2012/unix-intro/presos/permissions-exercises.pdf Notes Commands preceded with $ imply that you should execute the command as a general user an not as root. Content: Topics of slide set 2 Page 3 of 7

Commands preceded with # imply that you should working as root with sudo imply that you are executing commands on remote equipment, or within another program. REFERENCE If you look at files in a directory using ls -al you will see the permissions for each file and directory. Here is an example: drwxrwxr-x 3 bnc bnc 4096 Feb 25 09:49 directory -rwxr--r-- 12 bnc bnc 4096 Feb 16 05:02 file The left column is important. You can view it like this: Type User Group Other Links Owner Group Size Date Hour Name ===================================================================== d rwx rwx r-x 3 bnc bnc 4096 Feb 25 09:49 directory - rwx r r 12 bnc bnc 4096 Feb 16 05:02 file The directory has r (read), w (write), x (execute) access for the User (= Owner) and Group. For Other it has r (read) and x (execute) access. The file has r (read), w (write), x (execute) access for User and r (read) only access for everyone else (Group and Other). You can change permissions with the chmod command. chmod uses a base eight (octal) system to configure permissions. Or, you can use an alternate form to specify permissions by column (User/Group/Other) at a time. Permissions have values like this: Letter Permission Value =========================== r read 4 w write 2 x execute 1 - none 0 Thus you can give permissions to a file using the sum of the values for each permission you wish to give for each column. Here is an example: Content: Topics of slide set 2 Page 4 of 7

Letter Permission Value ========================================= --- none 0 --x execute 1 -w- write only (rarely used) 2 -wx write and execute (rare) 3 r-- read only 4 r-x read and execute 5 rw- read and write 6 rwx read, write, and execute 7 This is just one column. Since we have three areas of permissions (User, Group, Other), it looks like this, if you want to specify all 3 sets: Permissions Numeric Description equivalent -rw------- 600 User has read & execute permission. -rw-r--r-- 644 User has read & execute. Group and Other have read permission. -rw-rw-rw- 666 Everyone (User, Group, Other) has read & write permission (dangerous?) -rwx------ 700 User has read, write, execute permission. -rwxr-xr-x 755 User has read, write, execute permission. Rest of the world (Other) has read & execute permission (typical for web pages or 644). -rwxrwxrwx 777 Everyone has full access (read, write, execute). -rwx--x--x 711 User has read, write, execute permission. Group and world have execute permission. drwx------ 700 User only has access to this directory. Directories require execute permission to access. drwxr-xr-x 755 User has full access to directory. Everyone else can see the directory. drwx--x--x 711 Everyone can list files in the directory, but Group and Other need to know a filename to do this. 1.) CHANGING FILE PERMISSIONS If you are logged in as the root user on your machine please do the following to become a normal user. # exit Content: Topics of slide set 2 Page 5 of 7

Your prompt should change and now include a $ sign. $ Please check your username with the command whoami: $ whoami Please create a file and set permissions of the file in various ways. $ cd $ echo "test file" > working.txt $ chmod 444 working.txt What does that look like? $ ls -lah working.txt Because the file has no write permission for the owner, the owner can still change the file s permissions. This way, the owner can change the permissions of the file at any time to have write access again. $ chmod 644 working.txt Or, you can do this by using this form of chmod: $ chmod u+w working.txt Note: When you type these commands you should be able to use the tab key for command completion once you ve typed the w in the file name working.txt. This will save you a lot of time. It s highly recommended! To remove the read permission of a file for the user you would do $ chmod u-r working.txt Or, you can do something like this: $ chmod 344 working.txt Content: Topics of slide set 2 Page 6 of 7

You probably noticed that you can use the - (minus) sign to remove permissions from a file. Try reading your file: $ cat working.txt Now you cannot read your own file. Please make the file readable again by you with the chmod command. Look at your reference at the start of these tutorial to figure out what permissions are required. 2.) PROGRAM EXECUTION, PRIVILEGES AND SUDO As a general user you can see that there is a file called /etc/shadow: $ ls /etc/shadow But, you cannot see its contents: $ less /etc/shadow Figure out the permissions of this file. As a general user, however, you can see the content of the /etc/shadow file if you do the following: $ sudo less /etc/shadow What is sudo? Read about it: $ man sudo Content: Topics of slide set 2 Page 7 of 7